<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<jsp:include page="global.jsp"></jsp:include>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>项目组织管理</title>
<style type="text/css">
.ctl {
	text-decoration: none;
	color: blue;
	margin: auto 7px;
}

.ctl:HOVER {
	text-decoration: underline;
}

.center {
	text-align: center;
}
</style>
</head>
<body>
	<div class="easyui-tabs" style="width: 100%; height: 490px; overflow: auto;">
		<div title="项目详情" style="padding: 0px;">
			<table width="100%" height="100%">
				<tr>
					<td width="130px" align="right">项目名称：</td>
					<td>
						<input class="easyui-textbox" value="${project.name }" style="width: 200px;" readonly="readonly" />
					</td>
					<td width="100px" align="right">项目代号：</td>
					<td>
						<input class="easyui-textbox" value="${project.projectCode }" style="width: 200px;" readonly="readonly" />
					</td>
					<td width="130px" align="right">项目来源:</td>
					<td>
						<input class="easyui-textbox" value="${project.projectSource.name }" style="width: 200px;" readonly="readonly" />
					</td>
				</tr>
				<tr>
					<td align="right">报告频度:</td>
					<td>
						<input class="easyui-textbox" value="${project.projectReportFrequency.name }" style="width: 200px;" readonly="readonly" />
					</td>
					<td align="right">客户:</td>
					<td>
						<input class="easyui-textbox" value="${project.customer.name }" style="width: 200px;" readonly="readonly" />
					</td>
					<td align="right">项目类型:</td>
					<td>
						<input class="easyui-textbox" value="${project.projectType.name }" style="width: 200px;" readonly="readonly" />
					</td>
				</tr>
				<tr>
					<td align="right">归属部门:</td>
					<td>
						<input class="easyui-textbox" value="${project.department.name }" style="width: 200px;" readonly="readonly" />
					</td>
					<td align="right">创建日期:</td>
					<td>
						<input class="easyui-textbox" value='<fmt:formatDate value="${project.createDate }"/>' style="width: 200px;" readonly="readonly" />
					</td>
					<td align="right">项目开始日期:</td>
					<td>
						<input class="easyui-textbox" value='<fmt:formatDate value="${project.startDate }"/>' style="width: 200px;" readonly="readonly" />
					</td>
				</tr>
				<tr>
					<td align="right">初次计划完成日期:</td>
					<td>
						<input class="easyui-textbox" value='<fmt:formatDate value="${project.firstPlanFinishDate }"/>' style="width: 200px;" readonly="readonly" />
					</td>
					<td align="right">计划完成日期:</td>
					<td>
						<input class="easyui-textbox" value='<fmt:formatDate value="${project.planFinishDate }"/>' style="width: 200px;" readonly="readonly" />
					</td>
					<td align="right">实际完成日期:</td>
					<td>
						<input class="easyui-textbox" value='<fmt:formatDate value="${project.actualFinishDate }"/>' style="width: 200px;" readonly="readonly" />
					</td>
				</tr>
				<tr>
					<td align="right">课题工号:</td>
					<td>
						<input class="easyui-textbox" value="${project.projectPlanNo }" style="width: 200px;" readonly="readonly" />
					</td>
					<td align="right">批次号:</td>
					<td>
						<input class="easyui-textbox" value="${project.projectBatchNo }" style="width: 200px;" readonly="readonly" />
					</td>
					<td align="right">计划消耗工时:</td>
					<td>
						<input class="easyui-textbox" value="${project.planConsumeWorkTime }" style="width: 200px;" readonly="readonly" />
					</td>
				</tr>
				<tr>
					<td align="right">实际消耗工时:</td>
					<td>
						<input class="easyui-textbox" value="${project.actualConsumeWorktime }" style="width: 200px;" readonly="readonly" />
					</td>
					<td align="right">难度系数:</td>
					<td>
						<input class="easyui-textbox" value="${project.hardRate }" style="width: 200px;" readonly="readonly" />
					</td>
					<td align="right">计划完成时间变更次数:</td>
					<td>
						<input class="easyui-textbox" value="${project.planFinishDateChangeCount }" style="width: 200px;" readonly="readonly" />
					</td>
				</tr>
				<tr>
					<td align="right">项目描述：</td>
					<td colspan="7">
						<input class="easyui-textbox" value="${project.projectDescription }" style="width: 880px; height: 140px;" data-options="multiline:true" readonly="readonly" />
					</td>
				</tr>
			</table>
		</div>

		<div title="人员构成" style="padding: 2px; height: 100%;">
			<table id="projectMemberdg" class="easyui-datagrid"
				style="height: 100%;"
				data-options="
					rownumbers:true,
					singleSelect: true,
					singleSelect:true,
					pagination:true,
					fit:true,
					fitColumns:true,
					pageList:[20,25,30,35,40,45,50],
					pageSize:20
				">
				<thead>
					<tr>
						<th data-options="field:'personName',width:80,align:'center'">成员姓名</th>
						<th data-options="field:'projectMemberTypeName',width:100,align:'center'">成员类型</th>
						<th data-options="field:'predictConsumeWorktime',width:80,align:'center'">预计消耗工时</th>
						<th data-options="field:'actualConsumeWorktime',width:80,align:'center'">实际消耗工时</th>
						<th data-options="field:'planEnterDate',width:80,align:'center'">计划介入日期</th>
						<th data-options="field:'planExitDate',width:80,align:'center'">计划退出日期</th>
						<th data-options="field:'duty',width:100,align:'center'">职责</th>
						<th data-options="field:'id',width:40,align:'center',formatter:projectMemberFormatControl">查看</th>
					</tr>
				</thead>
			</table>

			<div id="projectMemberlookDetail" class="easyui-window" title="项目成员详情" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width: 720px; height: 400px; padding: 5px;">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'center'" style="padding: 10px;">
						<table width="100%" height="100%">
							<tr>
								<td width="160px;" align="right">成员姓名：</td>
								<td>
									<input class="easyui-textbox" id="lookPersonName" style="width: 200px;" readonly="readonly" />
								</td>
								<td width="130px;" align="right">成员类型：</td>
								<td>
									<input class="easyui-textbox" id="lookProjectMemberTypeId" style="width: 200px;" readonly="readonly" />
								</td>
							</tr>
							<tr>
								<td align="right">预计消耗工时：</td>
								<td>
									<input class="easyui-textbox" id="lookPredictConsumeWorktime" style="width: 200px;" readonly="readonly" />
								</td>
								<td align="right">实际消耗工时：</td>
								<td>
									<input class="easyui-textbox" id="lookActualConsumeWorktime" style="width: 200px;" readonly="readonly" />
								</td>
							</tr>
							<tr>
								<td align="right">计划介入项目日期：</td>
								<td>
									<input class="easyui-datebox" id="lookPlanEnterDate" style="width: 200px;" readonly="readonly" />
								</td>
								<td align="right">计划退出项目日期：</td>
								<td>
									<input class="easyui-datebox" id="lookPlanExitDate" style="width: 200px;" readonly="readonly" />
								</td>
							</tr>
							<tr>
								<td align="right">项目职责：</td>
								<td>
									<input class="easyui-textbox" id="lookDuty" style="width: 200px;" readonly="readonly" />
								</td>
								<td align="right">工时系数：</td>
								<td>
									<input class="easyui-textbox" id="lookWorktimeRate" style="width: 200px;" readonly="readonly" />
								</td>
							</tr>
							<tr>
								<td align="right">创建人：</td>
								<td>
									<input class="easyui-textbox" id="lookCreatePersonId" style="width: 200px;" readonly="readonly" />
								</td>
								<td align="right">创建时间：</td>
								<td>
									<input class="easyui-textbox" id="lookCreateTime" style="width: 200px;" readonly="readonly" />
								</td>
							</tr>
							<tr>
								<td align="right">备注：</td>
								<td colspan="3">
									<input class="easyui-textbox" data-options="multiline:true" style="width: 555px; height: 80px;" id="lookProjectMemberRemark" readonly="readonly" />
								</td>
							</tr>
						</table>
					</div>
					<div data-options="region:'south',border:false" style="text-align: right; padding: 5px 0 0;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:$('#projectMemberlookDetail').window('close')" style="width: 80px">关 闭</a>
					</div>
				</div>
			</div>

			<script type="text/javascript">
				function projectMemberFormatControl(val, row){
					return '<a class="ctl" href="javascript:void(0)" onclick="lookProjectMemberDetail(' + row.id + ')">查看</a>';
				}
				function lookProjectMemberDetail(id){
					var params = "id=" + id;
					$.ajax({
					  	type: "GET",
					  	url: "findProjectMember",
					  	data: params,
					  	success:function(data){
						  	var val = $.parseJSON(data);
							if(val.success){
								var item = val.data;

								$("#lookPersonName").textbox("setValue", item.personName);
								$("#lookProjectId").textbox("setValue", item.projectName);
								$("#lookCreatePersonId").textbox("setValue", item.createPersonName);
								$("#lookProjectMemberTypeId").textbox("setValue", item.projectMemberTypeName);
								$("#lookPredictConsumeWorktime").textbox("setValue", item.predictConsumeWorktime);
								$("#lookActualConsumeWorktime").textbox("setValue", item.actualConsumeWorktime);
								$("#lookPlanEnterDate").textbox("setValue", item.planEnterDate);
								$("#lookPlanExitDate").textbox("setValue", item.planExitDate);
								$("#lookDuty").textbox("setValue", item.duty);
								$("#lookWorktimeRate").textbox("setValue", item.worktimeRate);
								$("#lookCreateTime").textbox("setValue", item.createTime);
								$("#lookProjectMemberRemark").textbox("setValue", item.remark);
								
								$('#projectMemberlookDetail').window('open');
							}else{
								$.messager.alert("提示", val.msg, "error");
							}
					  	}
					});
				}
				function projectMemberSearch(){
					/*
					var person = $("#projectMemberPerson").combobox("getValue");
					var projectMemberType = $("#projectMemberProjectMemberType").combobox("getValue");
					var createPerson = $("#projectMemberCreatePerson").combobox("getValue");
					var duty = $("#projectMemberDutyId").textbox("getValue").trim();
					var url = "queryProjectMember?duty=" + duty + "&personId=" + person + "&projectId=${project.id}&projectMemberTypeId=" + projectMemberType + "&createPersonId=" + createPerson;
					*/
					var url = "queryProjectMember?projectId=${project.id}";
					
					$("#projectMemberdg").datagrid('reload', url);
				}
				$(function(){
					projectMemberSearch();
				});
			</script>

		</div>

		<div title="项目任务" style="padding: 2px;">
			<div class="easyui-layout" style="width:100%;height:100%;">
				<div data-options="region:'north',title:'项目任务'" style="height: 230px;">
					<table id="projectTaskdg" class="easyui-datagrid"
							data-options="
								rownumbers:true,
								singleSelect: true,
								toolbar: '#projectTasktb',
								singleSelect:true,
								pagination:true,
								fit:true,
								fitColumns:true,
								pageList:[5,10,15,20,25,30],
								pageSize:5
							">
						<thead>
							<tr>
								<th data-options="field:'ck',checkbox:true"></th>
								<th data-options="field:'projectName',width:80,align:'center'">项目</th>
								<th data-options="field:'projectTaskTypeName',width:80,align:'center'">任务类型</th>
								<th data-options="field:'planFinishDate',width:80,align:'center'">计划完成日期</th>
								<th data-options="field:'actualFinishDate',width:80,align:'center'">实际完成日期</th>
								<th data-options="field:'planWorktime',width:60,align:'center'">计划总工时</th>
								<th data-options="field:'actualWorktime',width:60,align:'center'">实际总工时</th>
								<th data-options="field:'taskDescription',width:180,align:'center'">任务描述</th>
								<th data-options="field:'status',width:40,align:'center'">状态</th>
								<th data-options="field:'id',width:100,align:'center',formatter:projectTaskFormatControl">管理</th>
							</tr>
						</thead>
					</table>
				
					<div id="projectTasktb" style="height:auto">
						<div>
							<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="initShowProjectTaskWindow()" >新增</a>
						</div>
						<div>
							任务类型:
							<select data-options="editable: false" id = "projectTaskProjectTaskType" class="easyui-combobox">
								<option value = "-1"> --全部-- </option>
								<c:forEach var="item" items="${projectTaskTypes }" >
									<option value = "${item.id }">${item.name }</option>
								</c:forEach>
							</select>
							任务状态：
							<select data-options="editable: false" class="easyui-combobox" id="projectTaskPersonStatus" style="width: 80px;">
								<option value="">--全部--</option>
								<option value="0001">未领取</option>
								<option value="0055">进行中</option>
								<option value="9000">已完成</option>
							</select>
							创建时间: <input class="easyui-datebox" type="text" id="projectTaskTaskCreateTimeBegin" style="width:150px;height:25px;">
							~ <input class="easyui-datebox" type="text" id="projectTaskTaskCreateTimeEnd" style="width:150px;height:25px;">
							<a href="javascript:projectTaskSearch()" class="easyui-linkbutton" iconCls="icon-search">查 找</a>
						</div>
					</div>
					
					<div id="lookDetail" class="easyui-window" title="项目任务详情" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:700px; height:350px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<table width="100%" height="100%">
									<tr>
										<td width="150px;" align="right">创建人：</td>
										<td>
											<input class="easyui-textbox" id="lookTaskCreatorId" data-options="required:true" readonly="readonly" style="width: 200px;" />
										</td>
										<td align="right">创建日期：</td>
										<td>
											<input class="easyui-datebox" id="lookTaskCreateTime" data-options="required:true" readonly="readonly" style="width: 200px;" />
										</td>
									</tr>
									<tr>
										<td width="120px;" align="right">任务类型：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskTypeId" data-options="required:true" readonly="readonly" style="width: 200px;" />
										</td>
										<td align="right">状态：</td>
										<td>
											<input class="easyui-textbox" id="lookStatus" data-options="required:true" readonly="readonly" style="width: 200px;" />
										</td>
									</tr>
									<tr>
										<td align="right">任务描述：</td>
										<td colspan="3">
											<input class="easyui-textbox" data-options="multiline:true, required:true" style="width: 545px; height: 80px;" id="lookTaskDescription" readonly="readonly">
										</td>
									</tr>
									<tr>
										<td align="right">计划完成日期：</td>
										<td>
											<input class="easyui-datebox" id="lookPlanFinishDate" data-options="required:true" readonly="readonly" style="width: 200px;" />
										</td>
										<td align="right">实际完成日期：</td>
										<td>
											<input class="easyui-datebox" id="lookActualFinishDate" data-options="required:true" readonly="readonly" style="width: 200px;" />
										</td>
									</tr>
									<tr>
										<td align="right">计划总工时：</td>
										<td>
											<input class="easyui-textbox" id="lookPlanWorktime" data-options="required:true" readonly="readonly" style="width: 200px;" />
										</td>
										<td align="right">实际总工时：</td>
										<td>
											<input class="easyui-textbox" id="lookActualWorktime" readonly="readonly" style="width: 200px;" />
										</td>
									</tr>
								</table>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:$('#lookDetail').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<div id="addItem" class="easyui-window" title="新增项目任务" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:650px; height:300px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<form id="projectTaskForm" method="post" action="editProjectTask" style = "width:100%; height: 100%">
									<input type="hidden" name="planFinishDateChangeCount" id="addProjectTaskPlanFinishDateChangeCount" value="0" />
									<input type="hidden" name="project.id" value="${project.id }" id="addProjectTaskProjectId" />
									<input type="hidden" name="taskCreator.id" value="${currentUser.id }" id="addProjectTaskTaskCreaterId" />
									<input type="hidden" name="status" value="0001" id="addProjectTaskStatus" />
									<table width="100%" height="100%">
										<tr>
											<td width="150px;" align="right">任务类型：</td>
											<td>
												<select name = "projectTaskType.id" class="easyui-combobox" data-options="required:true, editable: false" style="width: 200px;">
													<c:forEach var="item" items="${projectTaskTypes }" >
														<option value = "${item.id }">${item.name }</option>
													</c:forEach>
												</select>
											</td>
											<td align="right">计划总工时数：</td>
											<td>	
												<input class="easyui-numberbox" name="planWorktime" data-options="required:true, precision: 2" style="width: 200px;" />
											</td>
										</tr>
										<tr>
											<td width="150px;" align="right">计划完成日期：</td>
											<td colspan="3">
												<input class="easyui-datebox" name="planFinishDate" data-options="required:true" style="width: 200px;" />
											</td>
										</tr>
										<tr>
											<td align="right">任务描述：</td>
											<td colspan="3">
												<input class="easyui-textbox" data-options="multiline:true, required:true" style="width: 500px; height: 120px;" name="taskDescription">
											</td>
										</tr>
									</table>
								</form>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#projectTaskForm').submit()" style="width:80px">确 定</a>
								<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#addItem').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<div id="editProjectTaskItem" class="easyui-window" title="编辑项目任务" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:700px; height:300px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<form id="editProjectTaskForm" method="post" action="editProjectTask" style = "width:100%; height: 100%">
									<input type="hidden" id="editProjectTaskId" name = "id">
									<input type="hidden" name="project.id" id="editProjectTaskProjectId" />
									<input type="hidden" name="taskCreator.id" id="editProjectTaskTaskCreateId" />
									<input type="hidden" name="taskCreateTime" id="editProjectTaskTaskCreateTime" />
									<input type="hidden" name="status" value="0001" />
									<table width="100%" height="100%">
										<tr>
											<td width="150px;" align="right">任务类型：</td>
											<td>
												<select name = "projectTaskType.id" id="editProjectTaskProjectTaskTypeId" style="width: 200px;" class="easyui-combobox" data-options="required:true, editable: false" >
													<c:forEach var="item" items="${projectTaskTypes }" >
														<option value = "${item.id }">${item.name }</option>
													</c:forEach>
												</select>
											</td>
											<td width="150px;" align="right">计划总工时数：</td>
											<td>
												<input class="easyui-numberbox" data-options="precision: 2" name="planWorktime" id="editProjectTaskPlanWorktime" style="width: 200px;" />
											</td>
										</tr>
										<tr>
											<td width="150px;" align="right">计划完成日期：</td>
											<td>
												<input class="easyui-datebox" name="planFinishDate" id="editProjectTaskPlanFinishDate" data-options="required:true" style="width: 200px;" />
											</td>
										</tr>
										<tr>
											<td align="right">任务描述：</td>
											<td colspan="3">
												<input class="easyui-textbox" data-options="multiline:true, required:true" style="width: 545px; height: 80px;" name="taskDescription" id="editProjectTaskTaskDescription">
											</td>
										</tr>
									</table>
								</form>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#editProjectTaskForm').submit()" style="width:80px">确 定</a>
								<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#editProjectTaskItem').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<script type="text/javascript">
						function initShowProjectTaskWindow(){
							clearForm('projectTaskForm', 'addItem');
							$("#addProjectTaskPlanFinishDateChangeCount").val(0);
							$("#addProjectTaskProjectId").val('${project.id }');
							$("#addProjectTaskTaskCreaterId").val('${currentUser.id }');
							$("#addProjectTaskStatus").val('0001');
						}
						function projectTaskFormatControl(val, row){
							var content = '<a class="ctl" href="javascript:void(0)" onclick="lookProjectTaskDetail( ' + val + ')">查看</a>'
							if(row.statusCode == '0001'){
								content += ' <a class="ctl" href="javascript:void(0)" onclick="editProjectTaskItem(' + val + ')">编辑</a>'
								+' <a class="ctl" href="javascript:void(0)" onclick="delProjectTaskItem(' + val + ')">删除</a>';
							}
							return content;
						}
						function projectTaskSearch(){
							var status = $("#projectTaskPersonStatus").combobox("getValue");
							var projectTaskType = $("#projectTaskProjectTaskType").combobox("getValue");
							var taskCreateTimeBegin = $("#projectTaskTaskCreateTimeBegin").textbox("getValue").trim();
							var taskCreateTimeEnd = $("#projectTaskTaskCreateTimeEnd").textbox("getValue").trim();
							var url = "queryProjectTask?projectId=${project.id}&projectTaskTypeId=" + projectTaskType + "&taskCreateTimeBegin=" + taskCreateTimeBegin + "&taskCreateTimeEnd=" + taskCreateTimeEnd + "&status=" + status;
							$("#projectTaskdg").datagrid('reload', url);
						}
						function lookProjectTaskDetail(id){
							var params = "id=" + id;
							$.ajax({
							  	type: "GET",
							  	url: "findProjectTask",
							  	data: params,
							  	success:function(data){
								  	var val = $.parseJSON(data);
									if(val.success){
										var item = val.data;

										$("#lookTaskCreatorId").textbox("setValue", item.taskCreatorName);
										$("#lookProjectTaskTypeId").textbox("setValue", item.projectTaskTypeName);
										$("#lookTaskCreateTime").textbox("setValue", item.taskCreateTime);
										$("#lookPlanFinishDate").textbox("setValue", item.planFinishDate);
										$("#lookTaskDescription").textbox("setValue", item.taskDescription);
										$("#lookPlanWorktime").textbox("setValue", item.planWorktime);
										$("#lookActualWorktime").textbox("setValue", item.actualWorktime);
										$("#lookStatus").textbox("setValue", item.status);
										$("#lookActualFinishDate").textbox("setValue", item.actualFinishDate);
										
										$('#lookDetail').window('open');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
							  	}
							});
						}
						function editProjectTaskItem(id){
							var params = "id=" + id;
							$.ajax({
							  	type: "GET",
							  	url: "findProjectTask",
							  	data: params,
							  	success:function(data){
								  	var val = $.parseJSON(data);
									if(val.success){
										var item = val.data;

										$("#editProjectTaskId").val(id);
										$("#editProjectTaskProjectId").val(item.projectId);
										$("#editProjectTaskTaskCreateId").val(item.taskCreatorId);
										$("#editProjectTaskTaskCreateTime").val(item.taskCreateTime);
										$("#editProjectTaskProjectTaskTypeId").combobox("setValue", item.projectTaskTypeId);
										$("#editProjectTaskPlanFinishDate").textbox("setValue", item.planFinishDate);
										$("#editProjectTaskTaskAcceptTime").textbox("setValue", item.taskAcceptTime);
										$("#editProjectTaskTaskDescription").textbox("setValue", item.taskDescription);
										$("#editProjectTaskPlanWorktime").textbox("setValue", item.planWorktime);
										$("#editProjectTaskActualWorktime").textbox("setValue", item.actualWorktime);
										$("#editProjectTaskStatus").textbox("setValue", item.status);
										$("#editProjectTaskPlanFinishDate").textbox("setValue", item.planFinishDate);
							
										$('#editProjectTaskItem').window('open');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
							  	}
							});
						}
						function delProjectTaskItem(id){
							$.messager.confirm("删除确认", "您确定要删除所选的项目任务吗？", function(r){
								if(r){
									var params = "id=" + id;
									$.ajax({
									  	type: "GET",
									  	url: "delProjectTask",
									  	data: params,
									  	success:function(data){
										  	var val = $.parseJSON(data);
											if(val.success){
												bottomRight('提示', '删除成功！');
												$('#projectTaskdg').datagrid('reload');
											}else{
												$.messager.alert("提示", val.msg, "error");
											}
									  	}
									});
								}
							});
						}
						$(function(){
							$("#projectTaskdg").datagrid({onClickRow:function(rowIndex, rowData){
								projectTaskPersonSearch(rowData);
							}});
							$("#projectTaskForm").form({
								onSubmit: function(){
									var isValid = $(this).form('validate');
									return isValid;	// 返回false将停止form提交 
							    },
								success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
										$('#projectTaskdg').datagrid('reload');
										bottomRight('提示', '添加成功！');
										$('#addItem').window('close');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
								}
							});
							$("#editProjectTaskForm").form({
								onSubmit: function(){
									var isValid = $(this).form('validate');
									return isValid;	// 返回false将停止form提交 
							    },
								success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
										$('#projectTaskdg').datagrid('reload');
										bottomRight('提示', '修改成功！');
										$('#editProjectTaskItem').window('close');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
								}
							});
							//validateMenu
							projectTaskSearch();//页面装载完成后加载数据
						});
					</script>
				</div>
				<div data-options="region:'south',title:'项目任务分配'" style="height: 230px;">
					<table id="projectTaskPersondg" class="easyui-datagrid"
							data-options="
								rownumbers:true,
								singleSelect: true,
								toolbar: '#projectTaskPersontb',
								singleSelect:true,
								pagination:true,
								fit:true,
								fitColumns:true,
								pageList:[5,10,15,20,25,30],
								pageSize:5
							">
						<thead>
							<tr>
								<th data-options="field:'peopleName',align:'center',width:60,align:'center'">人员姓名</th>
								<th data-options="field:'chargePersonSign',align:'center',width:30,align:'center',formatter:function(val, row){return val == 'Y'?'是':'否'}">主责任人</th>
								<th data-options="field:'firstPlanFinishDate',align:'center',width:60,align:'center'">初次计划完成日期</th>
								<th data-options="field:'planFinishDate',align:'center',width:60,align:'center'">计划完成日期</th>
								<th data-options="field:'actualFinishDate',align:'center',width:60,align:'center'">实际完成日期</th>
								<th data-options="field:'duty',align:'center',width:150,align:'center'">职责</th>
								<th data-options="field:'status',align:'center',width:40,align:'center'">状态</th>
								<th data-options="field:'id',width:80,align:'center',formatter:projectTaskPersonFormatControl">管理</th>
							</tr>
						</thead>
					</table>
				
					<div id="projectTaskPersontb" style="height:auto">
						<div>
							<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="addProjectTaskPersonItem()">添加人员</a>
						</div>
						<div>
							人员:
							<select data-options="editable: false" id = "projectTaskPersonPeople" class="easyui-combobox">
								<option value = "-1"> --全部-- </option>
								<c:forEach var="item" items="${peoples }" >
									<option value = "${item.id }">${item.name }</option>
								</c:forEach>
							</select>
							职责: <input class="easyui-textbox" type="text" id="projectTaskPersonDuty" style="width:240px;height:25px;">
							<a href="javascript:findSearch()" class="easyui-linkbutton" iconCls="icon-search">查 找</a>
						</div>
					</div>
					
					<div id="lookProjectTaskPersonDetail" class="easyui-window" title="项目任务人员详情" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:670px; height:440px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<table width="100%" height="100%">
									<tr>
										<td width="130px;" align="right">任务：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonProjectTaskId" data-options="required:true" readonly="readonly" style="width: 180px;" />
										</td>
										<td width="130px;" align="right">人员名称：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonPeopleId" data-options="required:true" readonly="readonly" style="width: 180px;" />
										</td>
									</tr>
									<tr>
										<td align="right">主责人：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonChargePersonSign" data-options="required:true" readonly="readonly" style="width: 180px;" />
										</td>
										<td align="right">状态：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonStatus" data-options="required:true" readonly="readonly" style="width: 180px;" />
										</td>
									</tr>
									<tr>
										<td align="right">创建时间：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonTaskCreateTime" data-options="required:true" readonly="readonly" style="width: 180px;" />
										</td>
										<td align="right">领取时间：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonTaskAcceptTime" data-options="required:true" readonly="readonly" style="width: 180px;" />
										</td>
									</tr>
									<tr>
										<td align="right">计划完成日期：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonFirstPlanFinishDate" data-options="required:true" readonly="readonly" style="width: 180px;" />
										</td>
										<td align="right">实际完成日期：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonActualFinishDate" data-options="required:true" readonly="readonly" style="width: 180px;" />
										</td>
									</tr>
									<tr>
										<td align="right">计划工时数：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonPlanWorktime" data-options="required:true" readonly="readonly" style="width: 180px;" />
										</td>
										<td align="right">填报消耗工时：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonOriginalConsumeWorktime"  readonly="readonly" style="width: 180px;" />
										</td>
									</tr>
									<tr>
										<td align="right">确认消耗工时：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonConfirmConsumeWorktime"  readonly="readonly" style="width: 180px;" />
										</td>
										<td align="right">完成时间变更次数：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectTaskPersonPlanFinishDateChangeCount" data-options="required:true" readonly="readonly" style="width: 180px;" />
										</td>
									</tr>
									<tr>
										<td align="right">职责：</td>
										<td colspan="3">
											<input class="easyui-textbox" id="lookProjectTaskPersonDuty" style="width:500px;height:100px" data-options="multiline:true" data-options="required:true" />
										</td>
									</tr>
								</table>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:$('#lookProjectTaskPersonDetail').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<div id="addProjectTaskPersonItem" class="easyui-window" title="新增项目任务人员" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:630px; height:270px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<form id="projectTaskPersonForm" method="post" action="editProjetTaskPerson" style = "width:100%; height: 100%">
									<input type="hidden" name="projectTask.project.id" id="projectTaskPersonProjectId" />
									<input type="hidden" name="projectTask.id" id="addProjectTaskPersonProjectTaskId" />
									<input type="hidden" name="status" value="0001" id="addProjectTaskPersonStatus" />
									<table width="100%" height="100%">
										<tr>
											<td width="150px;" align="right">人员姓名：</td>
											<td>
												<select name = "people.id" class="easyui-combobox" data-options="required:true, editable: false" style="width:180px" >
													<c:forEach var="item" items="${peoples }" >
														<option value = "${item.id }">${item.name }</option>
													</c:forEach>
												</select>
											</td>
											<td align="right">主责任人：</td>
											<td>
												<select class="easyui-combobox" name="chargePersonSign" data-options="required:true, editable: false" style="width:180px">
													<option value="Y" selected="selected">是</option>
													<option value="N">否</option>
												</select>
											</td>
										</tr>
										<tr>
											<td align="right">计划完成日期：</td>
											<td>
												<input class="easyui-datebox" name="firstPlanFinishDate" id="addProjectTaskPersonPlanFinishDate" data-options="required:true, editable: false" style="width:180px" />
											</td>
											<td align="right">计划工时数：</td>
											<td>
												<input class="easyui-numberbox" name="planWorktime" id="addProjectTaskPersonPlanWorktime" data-options="required:true, precision: 2" style="width:180px" />
											</td>
										</tr>
										<tr>
											<td align="right">职责：</td>
											<td  colspan="3">
												<input class="easyui-textbox" name="duty" style="width:470px;height:100px" data-options="multiline:true" />
											</td>
										</tr>
										
									</table>
								</form>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#projectTaskPersonForm').submit()" style="width:80px">确 定</a>
								<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#addProjectTaskPersonItem').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<div id="editProjectTaskPersonItem" class="easyui-window" title="编辑项目任务人员" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:630px; height:270px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<form id="editProjectTaskPersonForm" method="post" action="editProjetTaskPerson" style = "width:100%; height: 100%">
									<input type="hidden" id="editProjectTaskPersonId" name = "id">
									<input type="hidden" name="project.id" value="${project.id }" />
									<input type="hidden" name="projectTask.id" id="editProjectTaskPersonProjectTaskId" />
									<input type="hidden" name="status" value="0001" id="editProjectTaskPersonStatus" />
									<table width="100%" height="100%">
										<tr>
											<td width="150px;" align="right">人员名称：</td>
											<td>
												<select name = "people.id" id="editProjectTaskPersonPeopleId" class="easyui-combobox" data-options="required:true, editable: false" style="width:180px">
													<c:forEach var="item" items="${peoples }" >
														<option value = "${item.id }">${item.name }</option>
													</c:forEach>
												</select>
											</td>
											<td align="right">主责任人：</td>
											<td>
												<select class="easyui-combobox" name="chargePersonSign" id="editProjectTaskPersonChargePersonSign" data-options="required:true, editable: false" style="width:180px">
													<option value="Y" selected="selected">是</option>
													<option value="N">否</option>
												</select>
											</td>
										</tr>
										<tr>
											<td align="right">计划完成日期：</td>
											<td>
												<input class="easyui-datebox" name="firstPlanFinishDate" id="editProjectTaskPersonPlanFinishDate" data-options="required:true" style="width:180px" />
											</td>
											<td align="right">计划工时数：</td>
											<td>
												<input class="easyui-textbox" name="planWorktime" id="editProjectTaskPersonPlanWorktime" data-options="required:true" style="width:180px" />
											</td>
										</tr>
										<tr>											
											<td align="right">职责：</td>
											<td  colspan="3">
												<input class="easyui-textbox" name="duty" id="editProjectTaskPersonDuty" style="width:470px;height:100px" data-options="multiline:true" />
											</td>
										</tr>
									</table>
								</form>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#editProjectTaskPersonForm').submit()" style="width:80px">确 定</a>
								<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#editProjectTaskPersonItem').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<script type="text/javascript">
						function projectTaskPersonFormatControl(val, row){
							var chargePersonSign = row.chargePersonSign == 'Y' ? '是' : '否';
							var content = '<a class="ctl" href="javascript:void(0)" onclick="lookProjectTaskPersonDetail(' + row.id + ')">查看</a>';
							if(row.statusCode == '0001'){
								content += ' <a class="ctl" href="javascript:void(0)" onclick="editProjectTaskPersonItem(' + val + ')">编辑</a>';
								content += ' <a class="ctl" href="javascript:void(0)" onclick="delProjectTaskPersonItem(' + val + ')">删除</a>';
							}
							return content;
						}
						function findSearch(){
							var row = $("#projectTaskdg").datagrid("getSelected");
							if(row){
								projectTaskPersonSearch(row);
							}
						}
						function projectTaskPersonSearch(rowData){
							var dg = $("#projectTaskPersondg");
							var projectTask = rowData.id; //$("#projectTaskPersonProjectTask").combobox("getValue");
							var people = $("#projectTaskPersonPeople").combobox("getValue");
							var duty = $("#projectTaskPersonDuty").textbox("getValue").trim();
							var url = "queryProjectTaskPerson?projectTaskId=" + projectTask + "&peopleId=" + people + "&duty=" + duty;
							dg.datagrid('reload', url);
						}
						function lookProjectTaskPersonDetail(id){
							var params = "id=" + id;
							$.ajax({
							  type: "GET",
							  url: "findProjectTaskPerson",
							  data: params,
							  success:function(data){
								  	var val = $.parseJSON(data);
									if(val.success){
										var item = val.data;

										$("#lookProjectTaskPersonProjectTaskId").textbox("setValue", item.taskDescription);
										$("#lookProjectTaskPersonPeopleId").textbox("setValue", item.peopleName);
										$("#lookProjectTaskPersonChargePersonSign").textbox("setValue", item.chargePersonSign == "Y"?"是":"否");
										$("#lookProjectTaskPersonStatus").textbox("setValue", item.status);
										$("#lookProjectTaskPersonDuty").textbox("setValue", item.duty);
										$("#lookProjectTaskPersonOriginalConsumeWorktime").textbox("setValue", item.originalConsumeWorktime);
										$("#lookProjectTaskPersonConfirmConsumeWorktime").textbox("setValue", item.confirmConsumeWorktime);
										$("#lookProjectTaskPersonTaskCreateTime").textbox("setValue", item.taskCreateTime);
										$("#lookProjectTaskPersonTaskAcceptTime").textbox("setValue", item.taskAcceptTime);
										$("#lookProjectTaskPersonPlanFinishDateChangeCount").textbox("setValue", item.planFinishDateChangeCount);
										$("#lookProjectTaskPersonPlanWorktime").textbox("setValue", item.planWorktime);
										$("#lookProjectTaskPersonFirstPlanFinishDate").textbox("setValue", item.firstPlanFinishDate);
										$("#lookProjectTaskPersonActualFinishDate").textbox("setValue", item.actualFinishDate);
										
										$('#lookProjectTaskPersonDetail').window('open');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
							  	}
							});
						}
						function addProjectTaskPersonItem(){
							var row = $("#projectTaskdg").datagrid("getSelected");
							if(row){
								clearForm('projectTaskPersonForm', 'addProjectTaskPersonItem');
								$('#projectTaskPersonProjectId').val('${project.id}');
								$('#addProjectTaskPersonProjectTaskId').val(row.id);
								$('#addProjectTaskPersonStatus').val("0001");
								$('#addProjectTaskPersonProjectTaskDescription').textbox("setValue", row.taskDescription);
								$('#addProjectTaskPersonPlanFinishDate').textbox("setValue", row.planFinishDate);
								$('#addProjectTaskPersonPlanWorktime').textbox("setValue", row.planWorktime);
							}else{
								bottomLeft("提示", "先选中任务才能分配人员！");
							}
						}
						function editProjectTaskPersonItem(id){
							var params = "id=" + id;
							$.ajax({
							  type: "GET",
							  url: "findProjectTaskPerson",
							  data: params,
							  success:function(data){
								  	var val = $.parseJSON(data);
									if(val.success){
										var item = val.data;

										$("#editProjectTaskPersonId").val(id);
										$("#editProjectTaskPersonProjectTaskId").val(item.projectTaskId);
										$("#editProjectTaskPersonPeopleId").combobox("setValue", item.peopleId);
										$("#editProjectTaskPersonChargePersonSign").combobox("setValue", item.chargePersonSign);
										$("#editProjectTaskPersonDuty").textbox("setValue", item.duty);
										$("#editProjectTaskPersonPlanFinishDate").textbox("setValue", item.firstPlanFinishDate);
										$("#editProjectTaskPersonPlanWorktime").textbox("setValue", item.planWorktime);
										
										$('#editProjectTaskPersonItem').window('open');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
							  	}
							});
						}
						function delProjectTaskPersonItem(id){
							$.messager.confirm("删除确认", "您确定要删除所选的项目任务人员吗？", function(r){
								if(r){
									var params = "id=" + id;
									$.ajax({
									  type: "GET",
									  url: "delProjectTaskPerson",
									  data: params,
									  success:function(data){
										  	var val = $.parseJSON(data);
											if(val.success){
												bottomRight('提示', '删除成功！');
												$('#projectTaskPersondg').datagrid('reload');
											}else{
												$.messager.alert("提示", val.msg, "error");
											}
									  	}
									});
								}
							});
						}
						$(function(){
							$("#projectTaskPersonForm").form({
								onSubmit: function(){
									var isValid = $(this).form('validate');
									return isValid;	// 返回false将停止form提交 
							    },
								success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
										bottomRight('提示', '添加成功！');
										$('#addProjectTaskPersonItem').window('close');
										findSearch();
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
								}
							});
							$("#editProjectTaskPersonForm").form({
								onSubmit: function(){
									var isValid = $(this).form('validate');
									return isValid;	// 返回false将停止form提交 
							    },
								success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
										bottomRight('提示', '修改成功！');
										$('#editProjectTaskPersonItem').window('close');
										findSearch();
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
								}
							});
						});
					</script>
				</div>
			</div>
			
		</div>

		<div title="项目报告维护" style="padding: 2px;">
			<table id="projectReportdg" class="easyui-datagrid"
					data-options="
						rownumbers:true,
						singleSelect: true,
						toolbar: '#projectReporttb',
						singleSelect:true,
						pagination:true,
						fit:true,
						fitColumns:true,
						pageList:[20,25,30,35,40,45,50],
						pageSize:20
					">
				<thead>
					<tr>
						<th data-options="field:'workProgress',width:200,align:'center'">项目进展</th>
						<th data-options="field:'workPlan',width:200,align:'center'">项目计划</th>
						<th data-options="field:'issueDescription',width:200,align:'center'">项目问题</th>
						<th data-options="field:'id',width:100,align:'center',formatter:projectReportFormatControl">管理</th>
					</tr>
				</thead>
			</table>
		
			<div id="projectReporttb" style="height:auto">
				<div>
					<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="clearForm('projectReportForm', 'addProjectReportItem');$('#addProjectReportProjectId').val(${project.id});$('#addProjectReportPeopleId').val(${currentUser.id });">新增</a>
				</div>
				<div>
					进展：
					<input class="easyui-textbox" style="width: 150px;" id="workProgress" />
					问题：
					<input class="easyui-textbox" style="width: 150px;" id="issueDescription" />
					<a href="javascript:projectReportSearch()" class="easyui-linkbutton" iconCls="icon-search">查 找</a>
				</div>
			</div>
			
			<div id="lookProjectReportDetail" class="easyui-window" title="项目报告详情" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:670px; height:465px;padding:5px;">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'center'" style="padding:10px;">
						<table width="100%" height="100%">
							<tr>
								<td width="130px;" align="right">项目进展：</td>
								<td colspan="3">
									<input class="easyui-textbox" data-options="multiline:true" style="width: 532px; height: 80px;" id="lookProjectReportWorkProgress" readonly="readonly">
								</td>
							</tr>
							<tr>
								<td align="right">项目计划：</td>
								<td colspan="3">
									<input class="easyui-textbox" data-options="multiline:true" style="width: 532px; height: 80px;" id="lookProjectReportWorkPlan" readonly="readonly">
								</td>
							</tr>
							<tr>
								<td align="right">项目问题：</td>
								<td colspan="3">
									<input class="easyui-textbox" data-options="multiline:true" style="width: 532px; height: 80px;" id="lookProjectReportIssueDescription" readonly="readonly">
								</td>
							</tr>
							<tr>
								<td align="right">描述：</td>
								<td colspan="3">
									<input class="easyui-textbox" data-options="multiline:true" style="width: 532px; height: 80px;" id="lookProjectReportRemark" readonly="readonly">
								</td>
							</tr>
						</table>
					</div>
					<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:$('#lookProjectReportDetail').window('close')" style="width:80px">关 闭</a>
					</div>
				</div>
			</div>
			
			<div id="addProjectReportItem" class="easyui-window" title="新增项目报告" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:670px; height:465px;padding:5px;">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'center'" style="padding:10px;">
						<form id="projectReportForm" method="post" action="editProjectReport" style = "width:100%; height: 100%">
							<input type="hidden" name="project.id" value="${project.id }" id="addProjectReportProjectId" />
							<input type="hidden" name="people.id" value="${currentUser.id }" id="addProjectReportPeopleId" />
							<table width="100%" height="100%">
								<tr>
									<td width="130px;" align="right">项目进展：</td>
									<td colspan="3">
										<input class="easyui-textbox" data-options="multiline:true, required:true" style="width: 532px; height: 80px;" name="workProgress">
									</td>
								</tr>
								<tr>
									<td align="right">项目计划：</td>
									<td colspan="3">
										<input class="easyui-textbox" data-options="multiline:true" style="width: 532px; height: 80px;" name="workPlan">
									</td>
								</tr>
								<tr>
									<td align="right">项目问题：</td>
									<td colspan="3">
										<input class="easyui-textbox" data-options="multiline:true" style="width: 532px; height: 80px;" name="issueDescription">
									</td>
								</tr>
								<tr>
									<td align="right">描述：</td>
									<td colspan="3">
										<input class="easyui-textbox" data-options="multiline:true" style="width: 532px; height: 80px;" name="remark">
									</td>
								</tr>
							</table>
						</form>
					</div>
					<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#projectReportForm').submit()" style="width:80px">确 定</a>
						<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#addProjectReportItem').window('close')" style="width:80px">关 闭</a>
					</div>
				</div>
			</div>
			
			<div id="editProjectReportItem" class="easyui-window" title="编辑项目报告" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:670px; height:465px;padding:5px;">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'center'" style="padding:10px;">
						<form id="editProjectReportForm" method="post" action="editProjectReport" style = "width:100%; height: 100%">
							<input type="hidden" id="editProjectReportId" name = "id">
							<input type="hidden" name="project.id" value="${project.id }" id="editProjectReportProjectId" />
							<input type="hidden" name="people.id" value="${currentUser.id }" id="editProjectReportPeopleId" />
							<table width="100%" height="100%">
								<tr>
									<td width="130px;" align="right">项目进展：</td>
									<td colspan="3">
										<input class="easyui-textbox" data-options="multiline:true, required:true" style="width: 532px; height: 80px;" name="workProgress" id="editProjectReportProjectWorkProgress">
									</td>
								</tr>
								<tr>
									<td align="right">项目计划：</td>
									<td colspan="3">
										<input class="easyui-textbox" data-options="multiline:true" style="width: 532px; height: 80px;" name="workPlan" id="editProjectReportProjectWorkPlan">
									</td>
								</tr>
								<tr>
									<td align="right">项目问题：</td>
									<td colspan="3">
										<input class="easyui-textbox" data-options="multiline:true" style="width: 532px; height: 80px;" name="issueDescription" id="editProjectReportProjectIssueDescription">
									</td>
								</tr>
								<tr>
									<td align="right">描述：</td>
									<td colspan="3">
										<input class="easyui-textbox" data-options="multiline:true" style="width: 532px; height: 80px;" name="remark" id="editProjectReportProjectRemark">
									</td>
								</tr>
							</table>
						</form>
					</div>
					<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#editProjectReportForm').submit()" style="width:80px">确 定</a>
						<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#editProjectReportItem').window('close')" style="width:80px">关 闭</a>
					</div>
				</div>
			</div>
			
			<script type="text/javascript">
				function projectReportFormatControl(val, row){
					return '<a class="ctl" href="javascript:void(0)" onclick="lookProjectReportDetail(' + val + ')">查看</a>'+
					' <a class="ctl" href="javascript:void(0)" onclick="editProjectReportItem(' + val + ')">编辑</a>'+
					' <a class="ctl" href="javascript:void(0)" onclick="delProjectReportItem(' + val + ')">删除</a>';
				}
				function projectReportSearch(){
					var workProgress = $("#workProgress").textbox("getValue");
					var issueDescription = $("#issueDescription").textbox("getValue");
					var url = "queryProjectReport?projectId=${project.id}&workProgress=" + workProgress + "&issueDescription=" + issueDescription;
					$("#projectReportdg").datagrid('reload', url);
				}
				function lookProjectReportDetail(id){
					var params = "id=" + id;
					$.ajax({
					  	type: "GET",
					  	url: "findProjectReport",
					  	data: params,
					  	success:function(data){
						  	var val = $.parseJSON(data);
							if(val.success){
								var item = val.data;

								$("#lookProjectReportWorkProgress").textbox("setValue", item.workProgress);
								$("#lookProjectReportWorkPlan").textbox("setValue", item.workPlan);
								$("#lookProjectReportIssueDescription").textbox("setValue", item.issueDescription);
								$("#lookProjectReportRemark").textbox("setValue", item.remark);
								
								$('#lookProjectReportDetail').window('open');
							}else{
								$.messager.alert("提示", val.msg, "error");
							}
					  	}
					});
				}
				function editProjectReportItem(id){
					var params = "id=" + id;
					$.ajax({
					  	type: "GET",
					  	url: "findProjectReport",
					  	data: params,
					  	success:function(data){
						  	var val = $.parseJSON(data);
							if(val.success){
								var item = val.data;

								$("#editProjectReportId").val(id);
								$("#editProjectReportProjectId").val(item.projectId);
								$("#editProjectReportPeopleId").val(item.peopleId);
								$("#editProjectReportProjectWorkProgress").textbox("setValue", item.workProgress);
								$("#editProjectReportProjectWorkPlan").textbox("setValue", item.workPlan);
								$("#editProjectReportProjectIssueDescription").textbox("setValue", item.issueDescription);
								$("#editProjectReportProjectRemark").textbox("setValue", item.remark);
								
								$('#editProjectReportItem').window('open');
							}else{
								$.messager.alert("提示", val.msg, "error");
							}
					  	}
					});
				}
				function delProjectReportItem(id){
					$.messager.confirm("删除确认", "您确定要删除所选的项目报告吗？", function(r){
						if(r){
							var params = "id=" + id;
							$.ajax({
							  	type: "GET",
							  	url: "delProjectReport",
							  	data: params,
							  	success:function(data){
								  	var val = $.parseJSON(data);
									if(val.success){
										bottomRight('提示', '删除成功！');
										$('#projectReportdg').datagrid('reload');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
							  	}
							});
						}
					});
				}
				$(function(){
					$("#projectReportForm").form({
						onSubmit: function(){
							var isValid = $(this).form('validate');
							return isValid;	// 返回false将停止form提交 
					    },
						success:function(data){
							var val = $.parseJSON(data);
							if(val.success){
								$('#projectReportdg').datagrid('reload');
								bottomRight('提示', '添加成功！');
								$('#addProjectReportItem').window('close');
							}else{
								$.messager.alert("提示", val.msg, "error");
							}
						}
					});
					$("#editProjectReportForm").form({
						onSubmit: function(){
							var isValid = $(this).form('validate');
							return isValid;	// 返回false将停止form提交 
					    },
						success:function(data){
							var val = $.parseJSON(data);
							if(val.success){
								$('#projectReportdg').datagrid('reload');
								bottomRight('提示', '修改成功！');
								$('#editProjectReportItem').window('close');
							}else{
								$.messager.alert("提示", val.msg, "error");
							}
						}
					});
					//validateMenu
					projectReportSearch();//页面装载完成后加载数据
				});
			</script>
		</div>

		<div title="项目节点" style="padding: 2px;">
			<table id="projectMilestonedg" class="easyui-datagrid"
				data-options="
						rownumbers:true,
						singleSelect: true,
						toolbar: '#projectMilestonetb',
						singleSelect:true,
						pagination:true,
						fit:true,
						fitColumns:true">
				<thead>
					<tr>
						<th data-options="field:'ck',checkbox:true"></th>
						<th data-options="field:'name',width:80,align:'center'">节点名称</th>
						<th data-options="field:'firstPlanFinishDate',width:80,align:'center'">初次计划完成日期</th>
						<th data-options="field:'planFinishDate',width:100,align:'center'">计划完成日期</th>
						<th data-options="field:'actualFinishDate',width:80,align:'center'">实际完成日期</th>
						<th data-options="field:'status',width:40,align:'center'">状态</th>
						<th data-options="field:'id',width:60,align:'center',formatter:projectMilestoneFormatControl">维护</th>
					</tr>
				</thead>
			</table>

			<div id="projectMilestonetb" style="height: auto">
				<div>
					项目节点名称: 
					<input class="easyui-textbox" type="text" id="projectMilestoneName" style="width: 240px; height: 25px;">
					<a href="javascript:projectMilestoneSearch()" class="easyui-linkbutton" iconCls="icon-search">查 找</a>
				</div>
			</div>

			<div id="lookProjectMilestoneDetail" class="easyui-window" title="项目节点详情" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width: 710px; height: 400px; padding: 5px;">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'center'" style="padding: 10px; width: 100px; height: 100%;">
						<table>
							<tr>
								<td width="100px" align="right">节点名称：</td>
								<td colspan="3">
									<input class="easyui-textbox" style="width: 540px;" readonly="readonly" id="lookProjectMilestoneName">
								</td>
							</tr>
							<tr>
								<td align="right">成果物及形式：</td>
								<td colspan="3">
									<input class="easyui-textbox" data-options="multiline:true" style="width: 540px; height: 80px;" readonly="readonly" id="lookProjectMilestoneDeliveryDescription" />
								</td>
							</tr>
							<tr>
								<td align="right">初次计划完成日期：</td>
								<td>
									<input class="easyui-datebox" readonly="readonly" id="lookProjectMilestoneFirstPlanFinishDate" style="width: 200px;" />
								</td>
								<td width="100px" align="right">计划完成时间：</td>
								<td>
									<input class="easyui-datebox" readonly="readonly" id="lookProjectMilestonePlanFinishDate" style="width: 200px;" />
								</td>
							</tr>
							<tr>
								<td align="right">实际完成日期：</td>
								<td>
									<input class="easyui-datebox" readonly="readonly" id="lookProjectMilestoneActualFinishDate" style="width: 200px;" />
								</td>
								<td align="right">计划调整次数：</td>
								<td>
									<input id="lookProjectMilestonePlanReviseCount" class="easyui-textbox" readonly="readonly" style="width: 200px;" />
								</td>
							</tr>
							<tr>
								<td width="130px;" align="right">状态：</td>
								<td>
									<input class="easyui-textbox" id="lookProjectMilestoneStatus" readonly="readonly" style="width: 200px;" />
								</td>
								<td align="right">质量检测点：</td>
								<td>
									<input class="easyui-textbox" readonly="readonly" id="lookProjectMilestoneQualityCheckSign" style="width: 200px;" />
								</td>
							</tr>
							<tr>
								<td align="right">备注：</td>
								<td colspan="3">
									<input class="easyui-textbox" data-options="multiline:true" style="width: 540px; height: 100px;" readonly="readonly" id="lookProjectMilestoneRemark">
								</td>
							</tr>
						</table>
					</div>
					<div data-options="region:'south',border:false" style="text-align: right; padding: 5px 0 0;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:$('#lookProjectMilestoneDetail').window('close')" style="width: 80px">关 闭</a>
					</div>
				</div>
			</div>

			<div id="lookProjectMilestoneChangeDetail" class="easyui-window" title="申请历史" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:900px; height:500px;padding:0px;">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'center'" style="padding:0px;">
						<iframe id="projectMilestoneChangeDetailWindow" width="100%" height="100%" frameborder="0"></iframe>
					</div>
					<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:$('#lookProjectMilestoneChangeDetail').window('close');$('#projectMilestonedg').datagrid('reload');" style="width:80px">关 闭</a>
					</div>
				</div>
			</div>

			<script type="text/javascript">
			/***********************************节点****************************************************/
				function projectMilestoneFormatControl(val, row){
					var content = '<a class="ctl" href="javascript:void(0)" onclick="lookProjectMilestoneDetail(' + row.id + ')">查看</a>';
					if(row.statusCode == "0001"){
						content += ' <a class="ctl" href="javascript:void(0)" onclick="pullDownProjectMilestone(' + val + ')">领取</a>';
					} else if(row.statusCode == "0055") {
						content += ' <a class="ctl" href="javascript:void(0)" onclick="projectMilestoneChangeDetail(' + val + ', \'' + row.name + '\')">延期</a>';
						content += ' <a class="ctl" href="javascript:void(0)" onclick="projectMilestoneFinishDetail(' + val + ', \'' + row.name + '\')">完成</a>';
					} else if(row.statusCode == "0200") {
						content += ' <a class="ctl" href="javascript:void(0)" onclick="projectMilestoneChangeDetail(' + val + ', \'' + row.name + '\')">申请延期进展</a>';
					} else if(row.statusCode == "0100" || row.statusCode == "1000") {
						content += ' <a class="ctl" href="javascript:void(0)" onclick="projectMilestoneFinishDetail(' + val + ', \'' + row.name + '\')">申请完成进展</a>';
					}
					return content;
				}
				function projectMilestoneChangeDetail(id, name){
					var url = "projectMilestoneChangemgr?projectMilestoneId=" + id;
					$("#projectMilestoneChangeDetailWindow").attr("src", url);
					$('#lookProjectMilestoneChangeDetail').window({title: "项目节点“" + name + "”申请延期管理"});
					$('#lookProjectMilestoneChangeDetail').window('open');
				}
				function projectMilestoneFinishDetail(id, name){
					var url = "projectMilestoneFinishApplymgr?projectMilestoneId=" + id;
					$("#projectMilestoneChangeDetailWindow").attr("src", url);
					$('#lookProjectMilestoneChangeDetail').window({title: "项目节点“" + name + "”申请完成管理"});
					$('#lookProjectMilestoneChangeDetail').window('open');
				}
				function initProjectMilestoneFinishApplyForm(id){
					clearForm("projectMilestoneFinishApplyForm", "projectMilestoneFinishApplyWindow");
					$("#projectMilestoneFinishApplyApplyPersonId").val('${currentUser.id}');
					$("#projectMilestoneFinishApplyProjectMilestoneId").val(id);
					$("#projectMilestoneFinishApplyStatus").val("0001");
				}
				function projectMilestoneSearch(){
					var name = $("#projectMilestoneName").textbox("getValue");
					var url = "queryProjectMilestone?projectId=${project.id}&name=" + name;
					$("#projectMilestonedg").datagrid('reload', url);
				}
				function lookProjectMilestoneDetail(id){
					var params = "id=" + id;
					$.ajax({
					  	type: "GET",
					  	url: "findProjectMilestone",
					  	data: params,
					  	success:function(data){
						  	var val = $.parseJSON(data);
							if(val.success){
								var item = val.data;

								$("#lookProjectMilestonePlanReviseCount").textbox("setValue", item.planReviseCount);
								$("#lookProjectMilestoneName").textbox("setValue", item.name);
								$("#lookProjectMilestoneDeliveryDescription").textbox("setValue", item.deliveryDescription);
								$("#lookProjectMilestoneFirstPlanFinishDate").textbox("setValue", item.firstPlanFinishDate);
								$("#lookProjectMilestonePlanFinishDate").textbox("setValue", item.planFinishDate);
								$("#lookProjectMilestoneActualFinishDate").textbox("setValue", item.actualFinishDate);
								$("#lookProjectMilestoneQualityCheckSign").textbox("setValue", (item.qualityCheckSign == "Y")?"是":"否");
								$("#lookProjectMilestoneStatus").textbox("setValue", item.status);
								$("#lookProjectMilestoneRemark").textbox("setValue", item.remark);
								
								$('#lookProjectMilestoneDetail').window('open');
							}else{
								$.messager.alert("提示", val.msg, "error");
							}
					  	}
					});
				}
				
				function pullDownProjectMilestone(id){
					var params = "id=" + id + "&status=0055";
					$.ajax({
					  	type: "POST",
					  	url: "pullDownProjectMilestone",
					  	data: params,
					  	success:function(data){
						  	var val = $.parseJSON(data);
							if(val.success){
								bottomRight('提示', '领取成功！');
								$('#projectMilestonedg').datagrid('reload');
							}else{
								$.messager.alert("提示", val.msg, "error");
							}
					  	}
					});
				}
				
				function delProjectMilestoneItem(id){
					$.messager.confirm("删除确认", "您确定要删除所选的项目节点吗？", function(r){
						if(r){
							data = "id=" + id;
							$.ajax({
							  type: "GET",
							  url: "delProjectMilestone",
							  data: data,
							  success:function(data){
								  	var val = $.parseJSON(data);
									if(val.success){
										bottomRight('提示', '操作成功！');
										$('#projectMilestonedg').datagrid('reload');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
							  }
							});
						}
					});
				}
				 $(function(){
				 	$("#projectMilestonedg").datagrid({
						onClickRow : function(rowIndex, rowData) {
							projectMilestoneChangeSearch(rowData);
						}
					}); 
					$("#projectMilestoneFinishApplyForm").form({
						onSubmit: function(){
							var isValid = $(this).form('validate');
							return isValid;	// 返回false将停止form提交 
					    },
						success:function(data){
							var val = $.parseJSON(data);
							if(val.success){
								bottomRight('提示', '操作成功，等待审批！');
								$('#projectMilestonedg').datagrid('reload');						
								$('#projectMilestoneFinishApplyWindow').window('close');
							}else{
								$.messager.alert("提示", val.msg, "error");
							}
						}
					});
					projectMilestoneSearch();//页面装载完成后加载数据
				}); 
				
				/* $(function(){
					
					 $("#projectMilestonetb").datagrid({
						onClickRow : function(rowIndex, rowData) {
							projectMilestoneChangeSearch(rowData);
						}
					}); 
					projectMilestoneSearch();//页面装载完成后加载数据
				}); */
			</script>
		</div>

		<!-- 
		<div title="项目干系人维护" style="padding: 2px;">
			<table id="projectStakeholderdg" class="easyui-datagrid"
				data-options="
							rownumbers:true,
							singleSelect: true,
							toolbar: '#projectStakeholdertb',
							singleSelect:true,
							pagination:true,
							fit:true,
							fitColumns:true,
							pageList:[20,25,30,35,40,45,50],
							pageSize:20
						">
				<thead>
					<tr>
						<th data-options="field:'name',width:80,align:'center'">姓名</th>
						<th data-options="field:'projectStakeholderTypeName',width:80,align:'center'">干系人类型</th>
						<th data-options="field:'department',width:100,align:'center'">部门</th>
						<th data-options="field:'post',width:80,align:'center'">职务</th>
						<th data-options="field:'personalTel',width:60,align:'center'">个人电话</th>
						<th data-options="field:'officeTel',width:60,align:'center'">办公电话</th>
						<th data-options="field:'id',width:80,align:'center',formatter:projectStakeholderFormatControl">管理</th>
					</tr>
				</thead>
			</table>

			<div id="projectStakeholdertb" style="height: auto">
				<div>
					<a href="javascript:void(0)" class="easyui-linkbutton"
						data-options="iconCls:'icon-add',plain:true"
						onclick="clearForm('projectStakeholderForm', 'addProjectStakeholderMenu');$('#projectStakeholderProjectId').val(${project.id});$('#projectStakeholderProjectStakeholderTypeId').val(${projectStakeholderType.id });">新增</a>
				</div>
				<div>
					干系人姓名: <input class="easyui-textbox" type="text"
						id="projectStakeholderName" style="width: 240px; height: 25px;">
					<a href="javascript:projectStakeholderSearch()"
						class="easyui-linkbutton" iconCls="icon-search">查 找</a>
				</div>
			</div>

			<div id="lookProjectStakeholderDetail" class="easyui-window"
				title="项目干系人详情"
				data-options="modal:true,closed:true,iconCls:'icon-search'"
				style="width: 700px; height: 370px; padding: 5px;">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'center'" style="padding: 10px;">
						<table width="100%" height="100%">
							<tr>
								<td width="150px;" align="right">干系人类别：</td>
								<td width="160px"><input class="easyui-textbox" name="name"
									id="lookProjectStakeholderProjectStakeholderTypeId"
									data-options="required:true" style="width: 200px;"
									readonly="readonly" /></td>
								<td align="right">姓名：</td>
								<td><input class="easyui-textbox" name="name"
									id="lookProjectStakeholderName" data-options="required:true"
									style="width: 200px;" readonly="readonly" /></td>
							</tr>
							<tr>
								<td align="right">部门：</td>
								<td><input class="easyui-textbox" name="department"
									id="lookProjectStakeholderDepartment" style="width: 200px;"
									readonly="readonly" /></td>
								<td align="right">职务：</td>
								<td><input class="easyui-textbox" name="post"
									id="lookProjectStakeholderPost" style="width: 200px;"
									readonly="readonly" /></td>
							</tr>
							<tr>
								<td align="right">个人电话：</td>
								<td><input class="easyui-textbox" name="personalTel"
									id="lookProjectStakeholderPersonalTel" style="width: 200px;"
									readonly="readonly" /></td>
								<td align="right">办公电话：</td>
								<td><input class="easyui-textbox" name="officeTel"
									id="lookProjectStakeholderOfficeTel" style="width: 200px;"
									readonly="readonly" /></td>
							</tr>
							<tr>
								<td align="right">描述：</td>
								<td colspan="3"><input class="easyui-textbox"
									data-options="multiline:true"
									style="width: 480px; height: 80px;" name="remark"
									id="lookProjectStakeholderRemark" readonly="readonly" /></td>
							</tr>
						</table>
					</div>
					<div data-options="region:'south',border:false"
						style="text-align: right; padding: 5px 0 0;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'"
							href="javascript:void(0)"
							onclick="javascript:$('#lookProjectStakeholderDetail').window('close')"
							style="width: 80px">关 闭</a>
					</div>
				</div>
			</div>

			<div id="addProjectStakeholderMenu" class="easyui-window" title="新增项目干系人" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width: 650px; height: 370px; padding: 5px;">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'center'" style="padding: 10px;">
						<form id="projectStakeholderForm" method="post"
							action="editProjectStakeholder" style="width: 100%; height: 100%">
							<input type="hidden" name="project.id" id="projectStakeholderProjectId" />
							<input type="hidden" name="projectStakeholderType.id" value="${projectStakeholderType.id }" id="projectStakeholderProjectStakeholderTypeId" />
							<table width="100%" height="100%">
								<tr>
									<td align="right">姓名：</td>
									<td>
										<input class="easyui-textbox" name="name" data-options="required:true" style="width: 200px;" />
									</td>
									<td align="right">部门：</td>
									<td>
										<input class="easyui-textbox" name="department" style="width: 200px;" />
									</td>
								</tr>
								<tr>
									<td align="right">个人电话：</td>
									<td>
										<input class="easyui-textbox" name="personalTel" style="width: 200px;" />
									</td>
									<td align="right">办公电话：</td>
									<td>
										<input class="easyui-textbox" name="officeTel" style="width: 200px;" />
									</td>
								</tr>
								<tr>
									<td align="right">职务：</td>
									<td colspan="3">
										<input class="easyui-textbox" name="post" style="width: 500px;" />
									</td>
								</tr>
								<tr>
									<td align="right">描述：</td>
									<td colspan="3">
										<input class="easyui-textbox" data-options="multiline:true" style="width: 500px; height: 120px;" name="remark">
									</td>
								</tr>
							</table>
						</form>
					</div>
					<div data-options="region:'south',border:false" style="text-align: right; padding: 5px 0 0;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#projectStakeholderForm').submit()" style="width: 80px">确 定</a>
						<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#addProjectStakeholderMenu').window('close')" style="width: 80px">关 闭</a>
					</div>
				</div>
			</div>

			<div id="editProjectStakeholderMenu" class="easyui-window"
				title="编辑项目干系人"
				data-options="modal:true,closed:true,iconCls:'icon-search'"
				style="width: 700px; height: 370px; padding: 5px;">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'center'" style="padding: 10px;">
						<form id="editProjectStakeholderForm" method="post" action="editProjectStakeholder" style="width: 100%; height: 100%">
							<input type="hidden" id="editProjectStakeholderId" name="id"> 
							<input type="hidden" name="project.id" value="${project.id }" />
							<input type="hidden" name="projectStakeholderType.id" value="${projectStakeholderType.id }" id="editProjectStakeholderTypeId" />
							<table width="100%" height="100%">
								<tr>
									<td align="right">姓名：</td>
									<td>
										<input class="easyui-textbox" name="name" id="editName" data-options="required:true" style="width: 200px;" />
									</td>
									<td align="right">部门：</td>
									<td>
										<input class="easyui-textbox" name="department" id="editDepartment" style="width: 200px;" />
									</td>
								</tr>
								<tr>
									<td align="right">个人电话：</td>
									<td>
										<input class="easyui-textbox" name="personalTel" id="editPersonalTel" style="width: 200px;" />
									</td>
									<td align="right">办公电话：</td>
									<td>
										<input class="easyui-textbox" name="officeTel" id="editOfficeTel" style="width: 200px;" />
									</td>
								</tr>
								<tr>
									<td align="right">职务：</td>
									<td colspan="3">
										<input class="easyui-textbox" name="post" id="editPost" style="width: 200px;" />
									</td>
								</tr>
								<tr>
									<td align="right">描述：</td>
									<td colspan="3">
										<input class="easyui-textbox" data-options="multiline:true" style="width: 500px; height: 80px;" name="remark" id="editRemark">
									</td>
								</tr>
							</table>
						</form>
					</div>
					<div data-options="region:'south',border:false" style="text-align: right; padding: 5px 0 0;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#editProjectStakeholderForm').submit()" style="width: 80px">确 定</a>
						<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#editProjectStakeholderMenu').window('close')" style="width: 80px">关 闭</a>
					</div>
				</div>
			</div>

			<script type="text/javascript">
					function projectStakeholderFormatControl(val, row){
						return '<a class="ctl" href="javascript:void(0)" onclick="lookProjectStakeholderDetail(' + row.projectId + ',\'' + row.projectStakeholderTypeName + '\', \'' + row.name + '\', \'' + row.department + '\', \'' + row.post + '\', \'' + row.personalTel + '\', \'' + row.officeTel + '\', \'' + row.remark + '\')">查看</a>'+
						' <a class="ctl" href="javascript:void(0)" onclick="editProjectStakeholderMenu(' + val + ',' + row.projectId + ',' + row.projectStakeholderTypeId + ', \'' + row.name + '\', \'' + row.department + '\', \'' + row.post + '\', \'' + row.personalTel + '\', \'' + row.officeTel + '\', \'' + row.remark + '\')">编辑</a>'+
						' <a class="ctl" href="javascript:void(0)" onclick="delProjectStakeholderMenu(' + val + ')">删除</a>';
					}
					function projectStakeholderSearch(){
						var name = $("#projectStakeholderName").textbox("getValue");
						var url = "queryProjectStakeholder?personID=false&name=" + name + "&projectId=${project.id}";
						$("#projectStakeholderdg").datagrid('reload', url);
					}
					function lookProjectStakeholderDetail(projectId, projectStakeholderTypeName, name, department, post, personalTel, officeTel, remark){
						$("#lookProjectStakeholderProjectStakeholderTypeId").textbox("setValue", projectStakeholderTypeName);
						$("#lookProjectStakeholderName").textbox("setValue", name);
						$("#lookProjectStakeholderDepartment").textbox("setValue", department);
						$("#lookProjectStakeholderPost").textbox("setValue", post);
						$("#lookProjectStakeholderPersonalTel").textbox("setValue", personalTel);
						$("#lookProjectStakeholderOfficeTel").textbox("setValue", officeTel);
						$("#lookProjectStakeholderRemark").textbox("setValue", remark);
						
						$('#lookProjectStakeholderDetail').window('open');
					}
					function editProjectStakeholderMenu(id, projectId, projectStakeholderTypeId, name, department, post, personalTel, officeTel, remark){
						$("#editProjectStakeholderId").val(id);
						$("#editProjectStakeholderTypeId").val(projectStakeholderTypeId);
						$("#editName").textbox("setValue", name);
						$("#editDepartment").textbox("setValue", department);
						$("#editPost").textbox("setValue", post);
						$("#editPersonalTel").textbox("setValue", personalTel);
						$("#editOfficeTel").textbox("setValue", officeTel);
						$("#editRemark").textbox("setValue", remark);
						
						$('#editProjectStakeholderMenu').window('open');
					}
					function delProjectStakeholderMenu(id){
						$.messager.confirm("删除确认", "您确定要删除所选的项目干系人吗？", function(r){
							if(r){
								data = "id=" + id;
								$.ajax({
								  type: "GET",
								  url: "delProjectStakeholder",
								  data: data,
								  success:function(data){
									  	var val = $.parseJSON(data);
										if(val.success){
											bottomRight('提示', '操作成功！');
											$('#projectStakeholderdg').datagrid('reload');
										}else{
											$.messager.alert("提示", val.msg, "error");
										}
								  }
								});
							}
						});
					}
					$(function(){
						$("#projectStakeholderForm").form({
							onSubmit: function(){
								var isValid = $(this).form('validate');
								return isValid;	// 返回false将停止form提交 
						    },
							success:function(data){
								var val = $.parseJSON(data);
								if(val.success){
									$('#projectStakeholderdg').datagrid('reload');
									bottomRight('提示', '操作成功！');
									$('#addProjectStakeholderMenu').window('close');
								}else{
									$.messager.alert("提示", val.msg, "error");
								}
							}
						});
						$("#editProjectStakeholderForm").form({
							onSubmit: function(){
								var isValid = $(this).form('validate');
								return isValid;	// 返回false将停止form提交 
						    },
							success:function(data){
								var val = $.parseJSON(data);
								if(val.success){
									$('#projectStakeholderdg').datagrid('reload');
									bottomRight('提示', '操作成功！');
									$('#editProjectStakeholderMenu').window('close');
								}else{
									$.messager.alert("提示", val.msg, "error");
								}
							}
						});
						//validateMenu
						projectStakeholderSearch();//页面装载完成后加载数据
					});
				</script>


		</div>
		
 		-->
 				
		<div title="交付计划" style="padding: 2px;">
			<table id="projectProductdg" class="easyui-datagrid"
				data-options="
					rownumbers:true,
					singleSelect: true,
					toolbar: '#projectProducttb',
					singleSelect:true,
					pagination:true,
					fit:true,
					fitColumns:true,
					pageList:[20,25,30,35,40,45,50],
					pageSize:20
				">
				<thead>
					<tr>
						<th data-options="field:'productName',width:200,align:'center'">产品名称</th>
						<th data-options="field:'batchNo',width:100,align:'center'">批次号</th>
						<th data-options="field:'planDeliveryNumber',width:100,align:'center'">计划交付数量</th>
						<th data-options="field:'actualDeliveryNumber',width:100,align:'center'">已交付数量</th>
						<th data-options="field:'id',width:40,align:'center',formatter:projectProductFormatControl">查看</th>
					</tr>
				</thead>
			</table>
		
			<div id="projectProducttb" style="height:auto">
				<div>
					产品名称:
					<input class="easyui-textbox" type="text" id="projectProductProductName" style="width:240px;height:25px;">
					批次号: <input class="easyui-textbox" type="text" id="projectProductBatchNo" style="width:240px;height:25px;">
					<a href="javascript:projectProductSearch()" class="easyui-linkbutton" iconCls="icon-search">查 找</a>
				</div>
			</div>
			
			<div id="lookProjectProductDetail" class="easyui-window" title="项目产品详情" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:630px; height:230px;padding:5px;">
				<div class="easyui-layout" data-options="fit:true">
					<div data-options="region:'center'" style="padding:10px;">
						<table width="100%" height="100%">
							<tr>
								<td width="150px;" align="right">产品名称：</td>
								<td>
									<input class="easyui-textbox" id="lookProjectProductProductName" data-options="required:true" style="width: 200px;" readonly="readonly" />
								</td>
								<td width="120px;" align="right">批次号：</td>
								<td>
									<input class="easyui-textbox" id="lookProjectProductBatchNo" data-options="required:true" style="width: 200px;" readonly="readonly" />
								</td>
							</tr>
							<tr>
								<td width="100px;" align="right">计划交付数量：</td>
								<td>
									<input class="easyui-numberbox" data-options="precision: 2" id="lookProjectProductPlanDeliveryNumber" style="width: 200px;" readonly="readonly" />
								</td>
								<td width="100px;" align="right">已交付数量：</td>
								<td>
									<input class="easyui-textbox" id="lookProjectProductActualDeliveryNumber" style="width: 200px;" readonly="readonly" />
								</td>
							</tr>
						</table>
					</div>
					<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
						<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:$('#lookProjectProductDetail').window('close')" style="width:80px">关 闭</a>
					</div>
				</div>
			</div>
			
			<script type="text/javascript">
				function projectProductFormatControl(val, row){
					return '<a class="ctl" href="javascript:void(0)" onclick="lookProjectProductDetail(' + row.id + ')">查看</a>';
				}
				function projectProductSearch(){
					var productName = $("#projectProductProductName").textbox("getValue");
					var batchNo = $("#projectProductBatchNo").textbox("getValue").trim();
					var url = "queryProjectProduct?batchNo=" + batchNo + "&projectId=${project.id}&productName=" + productName;
					$("#projectProductdg").datagrid('reload', url);
				}
				function lookProjectProductDetail(id){
					var params = "id=" + id;
					$.ajax({
					  	type: "GET",
					  	url: "findProjectProduct",
					  	data: params,
					  	success:function(data){
							var val = $.parseJSON(data);
							if(val.success){
									var item = val.data;

									$("#lookProjectProductProductName").textbox("setValue", item.productName);
									$("#lookProjectProductBatchNo").textbox("setValue", item.batchNo);
									$("#lookProjectProductPlanDeliveryNumber").textbox("setValue", item.planDeliveryNumber);
									$("#lookProjectProductActualDeliveryNumber").textbox("setValue", item.actualDeliveryNumber);
									
									$('#lookProjectProductDetail').window('open');
							}else{
								$.messager.alert("提示", val.msg, "error");
							}
					  	}
					});
				}
				$(function(){
					projectProductSearch();
				});
			</script>
	
		</div>
		
		<div title="项目交付物维护" style="padding: 2px;">
			<div class="easyui-layout" style="width:100%;height:100%;">
				<div data-options="region:'north',title:'项目交付物'" style="height: 230px;">
					<table id="projectDeliverydg" class="easyui-datagrid"
						data-options="
							rownumbers:true,
							singleSelect: true,
							toolbar: '#projectDeliverytb',
							singleSelect:true,
							pagination:true,
							fit:true,
							fitColumns:true,
							pageList:[5,10,15,20,25,30],
							pageSize:5
						">
						<thead>
							<tr>
								<th data-options="field:'name',width:80,align:'center'">交付物名称</th>
								<th data-options="field:'productName',width:60,align:'center'">所属产品</th>
								<th data-options="field:'projectDeliveryTypeName',width:60,align:'center'">交付物类别</th>
								<th data-options="field:'projectCode',width:40,align:'center'">产品编号</th>
								<th data-options="field:'deliveryNumber',width:40,align:'center'">交付数量</th>
								<th data-options="field:'unit',width:30,align:'center'">单位</th>				
								<th data-options="field:'deliveryDate',width:60,align:'center'">交付日期</th>
								<th data-options="field:'status',width:40,align:'center'">状态</th>
								<th data-options="field:'id',width:90,align:'center',formatter:projectDeliveryFormatControl">管理</th>
							</tr>
						</thead>
					</table>
				
					<div id="projectDeliverytb" style="height:auto">
						<div>
							<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="initAddProjectDeliveryItem()">新增</a>
						</div>
						<div>
							交付物名称: <input class="easyui-textbox" type="text" id="projectDeliveryName" style="width:100px;height:25px;">
							批次号: <input class="easyui-textbox" type="text" id="projectDeliveryBatchNo" style="width:100px;height:25px;">
							我方经手人: 
							<input class="easyui-textbox" type="text" id="projectDeliveryOurHandler" style="width:100px;height:25px;">
							交付日期：<input class="easyui-datebox"  id="projectDeliveryDeliveryDateBegin" style="width:100px;height:25px;">
							~  <input class="easyui-datebox"  id="projectDeliveryDeliveryDateEnd" style="width:100px;height:25px;">
							<a href="javascript:projectDeliverySearch()" class="easyui-linkbutton" iconCls="icon-search">查 找</a>
						</div>
					</div>
					
					<div id="lookProjectDeliveryDetail" class="easyui-window" title="交付物详情" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:1030px; height:455px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<table width="100%" height="100%">
									<tr>
										<td width="100px" align="right">交付物名称：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryName" style="width: 200px;" readonly="readonly">
										</td>
										
										<td width="100px" align="right">所属产品：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryProductID" style="width: 200px;" readonly="readonly">
										</td>			
										
										<td width="100px" align="right">交付方式：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryDeLiveryWayNameDetail" style="width: 200px;" readonly="readonly">
										</td>
									</tr>
									
									<tr>
										
										<td align="right">交付物类别：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryProjectDeliveryTypeID" style="width: 200px;" readonly="readonly">
										</td>
										<td align="right">产品编号：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryProjectCode" style="width: 200px;" readonly="readonly">
										</td>
										
										<td align="right">批次号：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryBatchNo" style="width: 200px;" readonly="readonly">
										</td>
									</tr>
								
									<tr>
										<td align="right">生产厂家：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryProducer" style="width: 200px;" readonly="readonly">
										</td>
										
										<td align="right">交付日期：</td>
										<td>
											<input class="easyui-datebox" id="lookProjectDeliveryDeliveryDate" style="width: 200px;" readonly="readonly">
										</td>
										<td align="right">交付数量：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryDeliveryNumber" style="width: 200px;" readonly="readonly">
										</td>
									</tr>
								
									<tr>
										<td align="right">单位：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryUnit" style="width: 200px;" readonly="readonly">
										</td>
										
										<td align="right">状态：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryStatus" style="width: 200px;" readonly="readonly">
										</td>
										
										<td align="right">凭证号码：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryVoucherNo" style="width: 200px;" readonly="readonly">
										</td>
									</tr>
									
									<tr>
										<td align="right">录入人：</td>						
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryInputPerson" style="width: 200px;" readonly="readonly">
										</td>
										
										<td align="right">录入日期：</td>
										<td>
											<input class="easyui-datebox" id="lookProjectDeliveryInputTime" style="width: 200px;" readonly="readonly">
										</td>
										
										<td align="right">审核人：</td>						
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryCheckPerson" style="width: 200px;" readonly="readonly">
										</td>
									</tr>
													
									<tr>
										<td align="right">审核日期：</td>
										<td>
											<input class="easyui-datebox" id="lookProjectDeliveryCheckTime" style="width: 200px;" readonly="readonly">
										</td>
										<td align="right">我方经手人：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryOurHandler" style="width: 200px;" readonly="readonly">
										</td>
										
										<td align="right">对方经手人：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryCustomerHandler" style="width: 200px;" readonly="readonly">
										</td>	
									</tr>
									<tr>
										<td align="right">交付地点：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryDeliveryAddress" style="width: 200px;" readonly="readonly">
										</td>
										
										<td align="right">保修期限：</td>
										<td>
											<input class="easyui-textbox" id="lookProjectDeliveryWarrantyDate" style="width: 200px;" readonly="readonly">
										</td>
									</tr>
									<tr>
										<td align="right">规格参数：</td>
										<td colspan="5">
											<input class="easyui-textbox" id="lookProjectDeliverySpec" readonly="readonly" style="width: 860px; height: 80px;" data-options="multiline:true" />
										</td>
									</tr>
									<tr>
										<td align="right">备注：</td>
										<td colspan="5">
											<input class="easyui-textbox" id="lookProjectDeliveryRemark" readonly="readonly" style="width: 860px; height: 80px;" data-options="multiline:true" />
										</td>
									</tr>
								</table>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:$('#lookProjectDeliveryDetail').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<div id="addProjectDeliveryItem" class="easyui-window" title="新增交付物" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:1000px; height:450px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<form id="addProjectDeliveryForm" method="post" action="editProjectDelivery" style = "width:100%; height: 100%">
									<input type="hidden" name="project.id" value="${project.id }" id="addProjectDeliveryProjectId" />
									<input type="hidden" name="status" id="addProjectDeliveryStatus" />
									<input type="hidden" name = "product.id" id="addProjectDeliveryProductId" />
									<table width="100%" height="100%">
										<tr>
											<td width="100px" align="right">交付物类别：</td>
											<td>
												<select name = "projectDeliveryType.id" class="easyui-combobox" style="width: 200px;" data-options="required:true, editable: false">
													<c:forEach var="item" items="${projectDeliveryTypes }" >
														<option value = "${item.id }">${item.name }</option>
													</c:forEach>
												</select>
											</td>
											<td width="140px" align="right"><a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#projectDeliveryProductWindow').window('open');$('#projectDeliveryProductPrefix').val('add');">选择产品</a>交付物名称：</td>
											<td>
												<input class="easyui-textbox" name="name" id="addProjectDeliveryName" style="width: 200px;" data-options="required:true" />
											</td>
											<td width="100px" align="right">产品编号：</td>
											<td>
												<input class="easyui-textbox" name="projectCode" id="addProjectDeliveryProjectCode" style="width: 200px;" />
											</td>
										</tr>
										
										<tr>
											<td align="right">批次号：</td>
											<td>
												<input class="easyui-textbox" name="batchNo" style="width: 200px;" />
											</td>
											<td align="right">交付方式：</td>
											<td>
												<select name = "deliveryWay.id" class="easyui-combobox" style="width: 200px;" data-options="required:true, editable: false">
													<c:forEach var="item" items="${deliveryWays }" >
														<option value = "${item.id }">${item.name }</option>
													</c:forEach>
												</select>
											</td>
											<td align="right">交付日期：</td>
											<td>
												<input class="easyui-datebox" name="deliveryDate" style="width: 200px;" data-options="required:true"/>
											</td>
										</tr>
										
										<tr>
											<td align="right">交付数量：</td>
											<td>
												<input class="easyui-numberbox" data-options="required:true, precision: 2" name="deliveryNumber" style="width: 200px;" />
											</td>
											<td align="right">计量单位：</td>
											<td>
												<input class="easyui-textbox" name="unit" style="width: 200px;" />								
											</td>
											<td align="right">凭证号码：</td>
											<td>								
												<input class="easyui-textbox" name="voucherNo" style="width: 200px;" />
											</td>
										</tr>
										
										<tr>
											<td align="right">我方经手人：</td>
											<td>
												<input class="easyui-textbox" name="ourHandler" style="width: 200px;" data-options="required:true"/>
											</td>
											<td align="right">对方经手人：</td>
											<td>
												<input class="easyui-textbox" name="customerHandler" style="width: 200px;" data-options="required:true" />
											</td>
											<td align="right">保修期限：</td>
											<td>
												<input class="easyui-textbox" name="warrantyDate" style="width: 200px;"/>
											</td>
										</tr>
										
										<tr>
											<td align="right">交付地点：</td>
											<td>
												<input class="easyui-textbox" name="deliveryAddress" style="width: 200px;"/>
											</td>
											<td  align="right">生产厂家：</td>
											<td colspan="3">
												<input class="easyui-textbox" name="producer" style="width: 200px;" />
											</td>
										</tr>
										
										<tr>
											<td align="right">规格参数：</td>
											<td colspan="5">
												<input class="easyui-textbox" name="spec" style="width: 860px; height: 80px;" data-options="multiline:true" />
											</td>
										</tr>
										
										<tr>
											<td align="right">备注：</td>
											<td colspan="5">
												<input class="easyui-textbox" name="remark" style="width: 860px; height: 80px;" data-options="multiline:true"/>
											</td>
										</tr>
									</table>
								</form>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#addProjectDeliveryForm').submit()" style="width:80px">确 定</a>
								<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#addProjectDeliveryItem').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<div id="projectDeliveryProductWindow" class="easyui-window" title="选择产品" data-options="modal:true,iconCls:'icon-search', closed:true, minimizable: false, maximizable: false" style="width:300px;height:140px;padding:10px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<input type="hidden" id="projectDeliveryProductPrefix" />
								<select data-options="editable: false" class="easyui-combobox" style="width: 100%;" id="projectDeliveryProduct">
									<c:forEach var="item" items="${products }" >
										<option value = "${item.id }">${item.name }</option>
									</c:forEach>
								</select>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="selectedProjectDeliveryProduct()" style="width:80px">确 定</a>
								<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="cancelSelectProductDeliveryProduct()" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<div id="editProjectDeliveryItem" class="easyui-window" title="编辑交付物" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:1000px; height:450px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<form id="editProjectDeliveryForm" method="post" action="editProjectDelivery" style = "width:100%; height: 100%">
									<input type="hidden" id="editProjectDeliveryId" name = "id" />
									<input type="hidden" name = "inputPerson.id" id="editProjectDeliveryInputPerson" />
									<input type="hidden" name="inputTime" id="editProjectDeliveryInputTime" />
									<input type="hidden" name="status" id="editProjectDeliveryStatus" />
									<input type="hidden" name="project.id" value="${project.id }" id="editProjectDeliveryProjectId" />
									<input type="hidden" name = "product.id" id="editProjectDeliveryProductId" />
									<table width="100%" height="100%">
										<tr>
											<td width="100px" align="right">交付物类别：</td>
											<td>
												<select name = "projectDeliveryType.id" id="editProjectDeliveryProjectDeliveryTypeId" class="easyui-combobox" style="width: 200px;" data-options="required:true, editable: false">
													<c:forEach var="item" items="${projectDeliveryTypes }" >
														<option value = "${item.id }">${item.name }</option>
													</c:forEach>
												</select>
											</td>
											<td width="140px" align="right"><a href="javascript:void(0)" class="easyui-linkbutton" onclick="$('#projectDeliveryProductWindow').window('open');$('#projectDeliveryProductPrefix').val('edit');">选择产品</a>交付物名称：</td>
											<td>
												<input class="easyui-textbox" name="name" id="editProjectDeliveryName" style="width: 200px;" data-options="required:true" />
											</td>
											<td width="100px" align="right">产品编号：</td>
											<td>
												<input class="easyui-textbox" name="projectCode" id="editProjectDeliveryProjectCode" style="width: 200px;" />
											</td>
										</tr>
										
										<tr>
											<td align="right">批次号：</td>
											<td>
												<input class="easyui-textbox" name="batchNo" id="editProjectDeliveryBatchNo" style="width: 200px;" />
											</td>
											<td align="right">交付方式：</td>
											<td>
												<select name = "deliveryWay.id" id="editProjectDeliveryDeliveryWayId" class="easyui-combobox" style="width: 200px;" data-options="required:true, editable: false">
													<c:forEach var="item" items="${deliveryWays }" >
														<option value = "${item.id }">${item.name }</option>
													</c:forEach>
												</select>
											</td>
											<td align="right">交付日期：</td>
											<td>
												<input class="easyui-datebox" name="deliveryDate" id="editProjectDeliveryDeliveryDate" style="width: 200px;" data-options="required:true"/>
											</td>
										</tr>
										
										<tr>
											<td align="right">交付数量：</td>
											<td>
												<input class="easyui-numberbox" data-options="required:true, precision: 2" name="deliveryNumber" id="editProjectDeliveryDeliveryNumber" style="width: 200px;" />
											</td>
											<td align="right">单位：</td>
											<td>
												<input class="easyui-textbox" name="unit" id="editProjectDeliveryUnit" style="width: 200px;" />								
											</td>
											<td align="right">凭证号码：</td>
											<td>								
												<input class="easyui-textbox" name="voucherNo" id="editProjectDeliveryVoucherNo" style="width: 200px;" />
											</td>
										</tr>
										
										<tr>
											<td align="right">我方经手人：</td>
											<td>
												<input class="easyui-textbox" name="ourHandler" id="editProjectDeliveryOurHandler" style="width: 200px;" data-options="required:true"/>
											</td>
											<td align="right">对方经手人：</td>
											<td>
												<input class="easyui-textbox" name="customerHandler" id="editProjectDeliveryCustomerHandler" style="width: 200px;" data-options="required:true" />
											</td>
											<td align="right">保修期限：</td>
											<td>
												<input class="easyui-textbox" name="warrantyDate" id="editProjectDeliveryWarrantyDate" style="width: 200px;"/>
											</td>
										</tr>
										
										<tr>
											<td align="right">交付地点：</td>
											<td>
												<input class="easyui-textbox" name="deliveryAddress" id="editProjectDeliveryDeliveryAddress" style="width: 200px;"/>
											</td>
											<td  align="right">生产厂家：</td>
											<td colspan="3">
												<input class="easyui-textbox" name="producer" id="editProjectDeliveryProducer" style="width: 200px;" />
											</td>
										</tr>
										
										<tr>
											<td align="right">规格参数：</td>
											<td colspan="5">
												<input class="easyui-textbox" name="spec" id="editProjectDeliverySpec" style="width: 860px; height: 80px;" data-options="multiline:true" />
											</td>
										</tr>
										
										<tr>
											<td align="right">备注：</td>
											<td colspan="5">
												<input class="easyui-textbox" name="remark" id="editProjectDeliveryRemark" style="width: 860px; height: 80px;" data-options="multiline:true"/>
											</td>
										</tr>
									</table>
								</form>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#editProjectDeliveryForm').submit()" style="width:80px">确 定</a>
								<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#editProjectDeliveryItem').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<script type="text/javascript">
						function projectDeliveryFormatControl(val, row){
							var content = '<a class="ctl" href="javascript:void(0)" onclick="lookProjectDeliveryDetail(' + row.id + ')">查看</a>';
							if(row.statusCode == '0055'){
								content += ' <a class="ctl" href="javascript:void(0)" onclick="commitProjectDelivery(' + val + ')">提交</a>';
								content += ' <a class="ctl" href="javascript:void(0)" onclick="editProjectDeliveryItem(' + val + ')">编辑</a>';
								content += ' <a class="ctl" href="javascript:void(0)" onclick="delProjectDeliveryItem(' + val + ')">删除</a>';
							} else if(row.statusCode == '0100'){
								content += ' <a class="ctl" href="javascript:void(0)" onclick="revocationProjectDeliveryFinishApply(' + val + ')">撤销申请</a>';
							}
							return content;
						}
						function projectDeliverySearch(){
							var name = $("#projectDeliveryName").textbox("getValue").trim();
							var batchNo = $("#projectDeliveryBatchNo").textbox("getValue").trim();
							var ourHandler = $("#projectDeliveryOurHandler").textbox("getValue").trim();
							var deliveryDateBegin = $("#projectDeliveryDeliveryDateBegin").textbox("getValue").trim();
							var deliveryDateEnd = $("#projectDeliveryDeliveryDateEnd").textbox("getValue").trim();
							var url = "queryProjectDelivery?projectID=${project.id}&batchNo=" + batchNo + "&ourHandler=" + ourHandler + "&deliveryDateBegin=" + deliveryDateBegin + "&deliveryDateEnd=" + deliveryDateEnd + "&name=" + name;
							$("#projectDeliverydg").datagrid('reload', url);
						}
						function lookProjectDeliveryDetail(id){
							var params = "id=" + id;
							$.ajax({
							  	type: "GET",
							  	url: "findProjectDelivery",
							  	data: params,
							  	success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
											var item = val.data;

											$("#lookProjectDeliveryProductID").textbox("setValue", item.productID);
											$("#lookProjectDeliveryProjectDeliveryTypeID").textbox("setValue", item.projectDeliveryTypeID);
											$("#lookProjectDeliveryDeLiveryWayNameDetail").textbox("setValue", item.deliveryWayName);
											$("#lookProjectDeliveryInputPerson").textbox("setValue", item.inputPerson);
											$("#lookProjectDeliveryCheckPerson").textbox("setValue", item.checkPerson);
											$("#lookProjectDeliveryProducer").textbox("setValue", item.producer);
											$("#lookProjectDeliveryProjectCode").textbox("setValue", item.projectCode);
											$("#lookProjectDeliveryName").textbox("setValue", item.name);
											$("#lookProjectDeliveryBatchNo").textbox("setValue", item.batchNo);
											$("#lookProjectDeliverySpec").textbox("setValue", item.spec);
											$("#lookProjectDeliveryUnit").textbox("setValue", item.unit);
											$("#lookProjectDeliveryDeliveryNumber").textbox("setValue", item.deliveryNumber);
											$("#lookProjectDeliveryDeliveryDate").textbox("setValue", item.deliveryDate);
											$("#lookProjectDeliveryOurHandler").textbox("setValue", item.ourHandler);
											$("#lookProjectDeliveryCustomerHandler").textbox("setValue", item.customerHandler);
											$("#lookProjectDeliveryDeliveryAddress").textbox("setValue", item.deliveryAddress);
											$("#lookProjectDeliveryVoucherNo").textbox("setValue", item.voucherNo);
											$("#lookProjectDeliveryRemark").textbox("setValue", item.remark);
											$("#lookProjectDeliveryInputTime").textbox("setValue", item.inputTime);
											$("#lookProjectDeliveryCheckTime").textbox("setValue", item.checkTime);
											$("#lookProjectDeliveryStatus").textbox("setValue", item.status);
											$("#lookProjectDeliveryWarrantyDate").textbox("setValue", item.warrantyDate);
											
											$('#lookProjectDeliveryDetail').window('open');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
							  	}
							});
						}
						function editProjectDeliveryItem(id){
							var params = "id=" + id;
							$.ajax({
							  	type: "GET",
							  	url: "findProjectDelivery",
							  	data: params,
							  	success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
											var item = val.data;

											$("#editProjectDeliveryId").val(id);
											
											$("#editProjectDeliveryProjectId").val(item.projectID);
											$("#editProjectDeliveryProductId").val(item.productID);
											$("#editProjectDeliveryInputTime").val(item.inputTime);
											$("#editProjectDeliveryStatus").val(item.status);
											$("#editProjectDeliveryInputPerson").val(item.inputPerson);
											$("#editProjectDeliveryDeliveryWayID").combobox("setValue", item.deliveryWayID);
											$("#editProjectDeliveryProjectDeliveryTypeID").combobox("setValue", item.projectDeliveryTypeID);
											
											$("#editProjectDeliveryProducer").textbox("setValue", item.producer);
											$("#editProjectDeliveryProjectCode").textbox("setValue", item.projectCode);
											$("#editProjectDeliveryName").textbox("setValue", item.name);
											$("#editProjectDeliveryBatchNo").textbox("setValue", item.batchNo);
											$("#editProjectDeliverySpec").textbox("setValue", item.spec);
											$("#editProjectDeliveryUnit").textbox("setValue", item.unit);
											$("#editProjectDeliveryDeliveryNumber").textbox("setValue", item.deliveryNumber);
											$("#editProjectDeliveryDeliveryDate").textbox("setValue", item.deliveryDate);
											$("#editProjectDeliveryOurHandler").textbox("setValue", item.ourHandler);
											$("#editProjectDeliveryCustomerHandler").textbox("setValue", item.customerHandler);
											$("#editProjectDeliveryDeliveryAddress").textbox("setValue", item.deliveryAddress);
											$("#editProjectDeliveryVoucherNo").textbox("setValue", item.voucherNo);
											$("#editProjectDeliveryRemark").textbox("setValue", item.remark);
											$("#editProjectDeliveryWarrantyDate").textbox("setValue", item.warrantyDate);
											
											$('#editProjectDeliveryItem').window('open');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
							  	}
							});
						}
						function commitProjectDelivery(id){
							$.messager.confirm("提交确认", "您确定要提交所选的项目交付物吗？", function(r){
								if(r){
									params = "id=" + id + "&status=0100";
									$.ajax({
									  type: "GET",
									  url: "commitProjectDelivery",
									  data: params,
									  success:function(data){
										var val = $.parseJSON(data);
										if(val.success){
											bottomRight('提示', '操作成功！');
											$('#projectDeliverydg').datagrid('reload');
										}else{
											$.messager.alert("提示", val.msg, "error");
										}
									  }
									});
								}
							});
						}
						function revocationProjectDeliveryFinishApply(id){
							$.messager.confirm("撤销确认", "您确定要撤销所选的项目交付物吗？", function(r){
								if(r){
									params = "id=" + id + "&status=0055";
									$.ajax({
									  type: "GET",
									  url: "revocationProjectDeliveryFinishApply",
									  data: params,
									  success:function(data){
										var val = $.parseJSON(data);
										if(val.success){
											bottomRight('提示', '操作成功！');
											$('#projectDeliverydg').datagrid('reload');
										}else{
											$.messager.alert("提示", val.msg, "error");
										}
									  }
									});
								}
							});
						}
						function delProjectDeliveryItem(id){
							$.messager.confirm("删除确认", "您确定要删除所选的项目吗？", function(r){
								if(r){
									params = "id=" + id;
									$.ajax({
									  type: "GET",
									  url: "delProjectDelivery",
									  data: params,
									  success:function(data){
										var val = $.parseJSON(data);
										if(val.success){
											bottomRight('提示', '操作成功！');
											$('#projectDeliverydg').datagrid('reload');
										}else{
											$.messager.alert("提示", val.msg, "error");
										}
									  }
									});
								}
							});
						}
						function initAddProjectDeliveryItem(){
							clearForm('addProjectDeliveryForm', 'addProjectDeliveryItem');
							$('#addProjectDeliveryProjectId').val('${project.id}');
							$('#addProjectDeliveryStatus').val("0055");
						}
						function selectedProjectDeliveryProduct(){
							var value = $('#projectDeliveryProduct').combobox("getValue");
							var params = "id=" + value;
							$.ajax({
							  type: "GET",
							  url: "findProduct",
							  data: params,
							  success:function(data){
								var val = $.parseJSON(data);
								if(val.success){
									var prefix = $("#projectDeliveryProductPrefix").val();
									
									$("#" + prefix + "ProjectDeliveryProductId").val(val.msg.id);
									var projectDeliveryName = $("#" + prefix + "ProjectDeliveryName");
									var projectDeliveryProjectCode = $("#" + prefix + "ProjectDeliveryProjectCode");
									if(projectDeliveryName.val().trim() == ""){
										projectDeliveryName.textbox("setValue", val.msg.name);
									}
									if(projectDeliveryProjectCode.val().trim() == ""){
										projectDeliveryProjectCode.textbox("setValue", val.msg.productCode);
									}
									
									$("#projectDeliveryProductWindow").window("close");
								}else{
									$.messager.alert("提示", val.msg, "error");
								}
							  }
							});
						}
						function cancelSelectProductDeliveryProduct(){
							//$("#addProjectDeliveryProductId").val("");
							$('#projectDeliveryProductWindow').window('close');
						}
						$(function(){
							$("#projectDeliverydg").datagrid({onClickRow:function(rowIndex, rowData){
								projectDeliveryDetailSearch(rowData);
							}});
							$("#addProjectDeliveryForm").form({
								onSubmit: function(){
									var isValid = $(this).form('validate');
									return isValid;	// 返回false将停止form提交 
							    },
								success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
										$('#projectDeliverydg').datagrid('reload');
										bottomRight('提示', '操作成功！');
										$('#addProjectDeliveryItem').window('close');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
								}
							});
							$("#editProjectDeliveryForm").form({
								onSubmit: function(){
									var isValid = $(this).form('validate');
									return isValid;	// 返回false将停止form提交 
							    },
								success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
										$('#projectDeliverydg').datagrid('reload');
										bottomRight('提示', '操作成功！');
										$('#editProjectDeliveryItem').window('close');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
								}
							});
							projectDeliverySearch();
						});
					</script>
				</div>
				<div data-options="region:'south',title:'交付物明细'" style="height: 230px;">
					<table id="projectDeliveryDetaildg" class="easyui-datagrid"
						data-options="
							rownumbers:true,
							singleSelect: true,
							toolbar: '#projectDeliveryDetailtb',
							singleSelect:true,
							pagination:true,
							fit:true,
							fitColumns:true,
							pageList:[5,10,15,20,25,30],
							pageSize:5
						">
						<thead>
							<tr>				
								<th data-options="field:'productSequenceNo',width:80,align:'center'">产品序列号</th>
								<th data-options="field:'eTag',width:80,align:'center'">电子标识号</th>
								<th data-options="field:'remark',width:270,align:'center'">描述</th>
								<th data-options="field:'id',width:60,align:'center',formatter:projectDeliveryDetailFormatControl">管理</th>
							</tr>
						</thead>
					</table>
				
					<div id="projectDeliveryDetailtb" style="height:auto">
						<div>
							<a href="javascript:void(0)" class="easyui-linkbutton" data-options="iconCls:'icon-add',plain:true" onclick="initShowAddProjectDeliveryDetail()">新增</a>
						</div>
						<div>			
							产品序列号: <input class="easyui-textbox" type="text" id="productSequenceNo" style="width:200px;height:25px;">
							电子标识号: <input class="easyui-textbox" type="text" id="eTag" style="width:200px;height:25px;">
							<a href="javascript:projectDeliveryDetailSearch()" class="easyui-linkbutton" iconCls="icon-search">查 找</a>
						</div>
					</div>
					
					<div id="addProjectDeliveryDetailDetail" class="easyui-window" title="新增交付物明细" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:660px; height:250px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<form id="addProjectDeliveryDetailForm" method="post" action="editProjectDeliveryDetail" style = "width:100%; height: 100%">
									<input type="hidden" name="projectDelivery.id" id="addProjectDeliveryDetailProjectDeliveryId" />
									<table width="100%" height="100%">
										<tr>
											<td width="100px;" align="right">产品序列号：</td>
											<td>
												<input class="easyui-textbox" name="productSequenceNo" id="addProjectDeliveryDetailProductSequenceNo" data-options="required:true" style="width: 200px;" />
											</td>
											<td width="100px;" align="right">电子标识号：</td>
											<td>
												<input class="easyui-textbox" name="eTag" data-options="required:true" style="width: 200px;" />
											</td>
										</tr>
										<tr>
											<td align="right">描述：</td>
											<td colspan="3">
												<input class="easyui-textbox" data-options="multiline:true" style="width: 510px; height: 100px;" name="remark">
											</td>
										</tr>
									</table>
								</form>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#addProjectDeliveryDetailForm').submit()" style="width:80px">确 定</a>
								<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#addProjectDeliveryDetailDetail').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<div id="lookProjectDeliveryDetailDetail" class="easyui-window" title="交付物明细详情" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:600px; height:250px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<table width="100%" height="100%">
									<tr>
										<td width="100px;" align="right">产品序列号：</td>
										<td>
											<input class="easyui-textbox" id="lookProductSequenceNo" readonly="readonly" data-options="required:true" style="width: 150px;" />
										</td>
										<td width="100px;" align="right">电子标识号：</td>
										<td>
											<input class="easyui-textbox" id="lookETag" readonly="readonly" data-options="required:true" style="width: 150px;" />
										</td>
									</tr>
									<tr>
										<td align="right">描述：</td>
										<td colspan="3">
											<input class="easyui-textbox" data-options="multiline:true" style="width: 420px; height: 80px;" id="lookProjectDeliveryDetailRemark">
										</td>
									</tr>
								</table>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="javascript:$('#lookProjectDeliveryDetailDetail').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					
					<div id="editProjectDeliveryDetailDetail" class="easyui-window" title="编辑交付物明细" data-options="modal:true,closed:true,iconCls:'icon-search'" style="width:600px; height:250px;padding:5px;">
						<div class="easyui-layout" data-options="fit:true">
							<div data-options="region:'center'" style="padding:10px;">
								<form id="editProjectDeliveryDetailForm" method="post" action="editProjectDeliveryDetail" style = "width:100%; height: 100%">
									<input type="hidden" id="editProjectDeliveryDetailId" name = "id">
									<input type="hidden" name="projectDelivery.id" id="editProjectDeliveryDetailFProjectDeliveryId" />
									<table width="100%" height="100%">
										<tr>
											<td width="100px;" align="right">产品序列号：</td>
											<td>
												<input class="easyui-textbox" name="productSequenceNo" id="editProjectDeliveryDetailProductSequenceNo" data-options="required:true" style="width: 150px;" />
											</td>
											<td width="100px;" align="right">电子标识号：</td>
											<td>
												<input class="easyui-textbox" name="eTag" id="editProjectDeliveryDetailETag" data-options="required:true" style="width: 150px;" />
											</td>
										</tr>
										<tr>
											<td align="right">描述：</td>
											<td colspan="3">
												<input class="easyui-textbox" data-options="multiline:true" style="width: 420px; height: 80px;" name="remark" id="editProjectDeliveryDetailRemark" />
											</td>
										</tr>
									</table>
								</form>
							</div>
							<div data-options="region:'south',border:false" style="text-align:right;padding:5px 0 0;">
								<a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" href="javascript:void(0)" onclick="$('#editProjectDeliveryDetailForm').submit()" style="width:80px">确 定</a>
								<a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" href="javascript:void(0)" onclick="javascript:$('#editProjectDeliveryDetailDetail').window('close')" style="width:80px">关 闭</a>
							</div>
						</div>
					</div>
					<script type="text/javascript">
						function initShowAddProjectDeliveryDetail(){
							var row = $("#projectDeliverydg").datagrid("getSelected");
							if(row && row.statusCode == '0055'){
								clearForm('addProjectDeliveryDetailForm', 'addProjectDeliveryDetailDetail');
								
								$('#addProjectDeliveryDetailProjectDeliveryId').val(row.id);
								$('#addProjectDeliveryDetailProductSequenceNo').textbox('setValue', row.projectCode);
							}
						}
						function projectDeliveryDetailFormatControl(val, row){
							var content = '<a class="ctl" href="javascript:void(0)" onclick="lookProjectDeliveryDetailDetail(' + val + ')">查看</a>';
							var row = $("#projectDeliverydg").datagrid("getSelected");
							if(row.statusCode == '0055'){
								content += ' <a class="ctl" href="javascript:void(0)" onclick="editProjectDeliveryDetail(' + val + ')">编辑</a>';
								content += ' <a class="ctl" href="javascript:void(0)" onclick="delProjectDeliveryDetail(' + val + ')">删除</a>';
							}
							return content;
						}
						function projectDeliveryDetailFind(){
							var row = $("#projectDeliverydg").datagrid("getSelected");
							if(row){
								projectDeliveryDetailSearch(row);
							}
						}
						function projectDeliveryDetailSearch(rowData){
							var dg = $("#projectDeliveryDetaildg");
							var projectDeliveryId = rowData.id;
							var productSequenceNo = $("#productSequenceNo").textbox("getValue").trim();
							var eTag = $("#eTag").textbox("getValue").trim();
							var url = "queryProjectDeliveryDetail?projectDeliveryId=" + projectDeliveryId + "&productSequenceNo=" + productSequenceNo + "&eTag=" + eTag;
							dg.datagrid('reload', url);
						}
						function lookProjectDeliveryDetailDetail(id){
							var params = "id=" + id;
							$.ajax({
							  	type: "GET",
							  	url: "findProjectDeliveryDetail",
							  	data: params,
							  	success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
											var item = val.data;

											$("#lookProductSequenceNo").textbox("setValue", item.productSequenceNo);
											$("#lookETag").textbox("setValue", item.eTag);
											$("#lookProjectDeliveryDetailRemark").textbox("setValue", item.remark);
											
											$('#lookProjectDeliveryDetailDetail').window('open');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
							  	}
							});
						}
						function editProjectDeliveryDetail(id){
							var params = "id=" + id;
							$.ajax({
							  	type: "GET",
							  	url: "findProjectDeliveryDetail",
							  	data: params,
							  	success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
											var item = val.data;

											$("#editProjectDeliveryDetailId").val(id);
											$('#editProjectDeliveryDetailFProjectDeliveryId').val(item.projectDeliveryId);
											$('#editProjectDeliveryDetailProductSequenceNo').textbox('setValue', item.productSequenceNo);
											$("#editProjectDeliveryDetailETag").textbox("setValue", item.eTag);
											$("#editProjectDeliveryDetailRemark").textbox("setValue", item.remark);
											
											$('#editProjectDeliveryDetailDetail').window('open');
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
							  	}
							});
						}
						function delProjectDeliveryDetail(id){
							$.messager.confirm("删除确认", "您确定要删除所选的交付物明细吗？", function(r){
								if(r){
									params = "id=" + id;
									$.ajax({
									  type: "GET",
									  url: "delProjectDeliveryDetail",
									  data: params,
									  success:function(data){
										  	var val = $.parseJSON(data);
											if(val.success){
												bottomRight('提示', '操作成功！');
												$('#projectDeliveryDetaildg').datagrid('reload');
											}else{
												$.messager.alert("提示", val.msg, "error");
											}
									  }
									});
								}
							});
						}
						$(function(){
							$("#addProjectDeliveryDetailForm").form({
								onSubmit: function(){
									var isValid = $(this).form('validate');
									return isValid;	// 返回false将停止form提交 
							    },
								success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
										bottomRight('提示', '操作成功！');
										$('#addProjectDeliveryDetailDetail').window('close');
										projectDeliveryDetailFind();
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
								}
							});
							$("#editProjectDeliveryDetailForm").form({
								onSubmit: function(){
									var isValid = $(this).form('validate');
									return isValid;	// 返回false将停止form提交 
							    },
								success:function(data){
									var val = $.parseJSON(data);
									if(val.success){
										bottomRight('提示', '操作成功！');
										$('#editProjectDeliveryDetail').window('close');
										projectDeliveryDetailFind();
									}else{
										$.messager.alert("提示", val.msg, "error");
									}
								}
							});
						});
					</script>
				</div>
			</div>
		</div>
	</div>
</body>
</html>